Fix current time speed comparison (#1)
This commit is contained in:
parent
dcb6341c00
commit
83d01e03a5
5
init.lua
5
init.lua
@ -30,13 +30,14 @@ local function nightandday()
|
|||||||
local ns = S:get_int("night_time_speed") or 72
|
local ns = S:get_int("night_time_speed") or 72
|
||||||
|
|
||||||
local t = minetest.get_timeofday()
|
local t = minetest.get_timeofday()
|
||||||
|
local cts = tonumber(G:get("time_speed"))
|
||||||
|
|
||||||
if t > 0.25 and t <= 0.75 then
|
if t > 0.25 and t <= 0.75 then
|
||||||
if t ~= ds then
|
if cts ~= ds then
|
||||||
G:set("time_speed", ds)
|
G:set("time_speed", ds)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if t ~= ns then
|
if cts ~= ns then
|
||||||
G:set("time_speed", ns)
|
G:set("time_speed", ns)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user