mirror of
https://github.com/minetest-mods/time_regulation.git
synced 2025-01-08 17:10:24 +01:00
Ignore calls to time chatcommand if params == ""
- Set a check before throttling the time loop due to a time chatcommand input so that it doesn't recompute the ratio'd time speeds from an already ratio'd timespeed (small ratios would have time speeds exponentially bigger, and bigger ratios, exponentially slower time speeds) - For MinetestForFun/server-minetestforfun-skyblock#202
This commit is contained in:
parent
cef840ae04
commit
a73fd72805
6
init.lua
6
init.lua
@ -57,9 +57,9 @@ end
|
||||
|
||||
-- Crappy overrides
|
||||
local old_settime_func = core.chatcommands["time"].func
|
||||
core.chatcommands["time"].func = function(...)
|
||||
local res, msg = old_settime_func(...)
|
||||
if res and time_reg.status == time_reg.STATUS_ACTIVE then
|
||||
core.chatcommands["time"].func = function(name, params)
|
||||
local res, msg = old_settime_func(name, params)
|
||||
if params ~= "" and res and time_reg.status == time_reg.STATUS_ACTIVE then
|
||||
time_reg.log("Settime override : updating regulation", "verbose")
|
||||
time_reg.loop(false, true)
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user