Fix current time speed comparison (#1)

This commit is contained in:
Bruno Ribeiro 2019-06-09 15:49:06 -03:00 committed by SmallJoker
parent dcb6341c00
commit 83d01e03a5

View File

@ -30,13 +30,14 @@ local function nightandday()
local ns = S:get_int("night_time_speed") or 72
local t = minetest.get_timeofday()
local cts = tonumber(G:get("time_speed"))
if t > 0.25 and t <= 0.75 then
if t ~= ds then
if cts ~= ds then
G:set("time_speed", ds)
end
else
if t ~= ns then
if cts ~= ns then
G:set("time_speed", ns)
end
end