diff --git a/mods/nc_player_sky/timeofday.lua b/mods/nc_player_sky/timeofday.lua index 83762ebf..9e3c808f 100644 --- a/mods/nc_player_sky/timeofday.lua +++ b/mods/nc_player_sky/timeofday.lua @@ -1,37 +1,8 @@ -- LUALOCALS < --------------------------------------------------------- -local math, minetest, nodecore, string - = math, minetest, nodecore, string -local math_abs, string_format - = math.abs, string.format +local minetest + = minetest -- LUALOCALS > --------------------------------------------------------- -local fixedtime = 0.2 - -local warncount = 0 -local nextwarn = 0 -local function warn(curtime) - warncount = warncount + 1 - if nextwarn > 0 then return end - nodecore.log("warning", string_format( - "had to manually adjust time of day (e.g. %1.4f -> %1.4f)" - .. " %d time(s), which creates extra network traffic for all clients" - .. "; make sure time_speed = 0 (currently %d)", - curtime, fixedtime, warncount, minetest.settings:get("time_speed") or 72)) - nextwarn = 300 - warncount = 0 -end - -local timer = 0 -minetest.register_globalstep(function(dtime) - nextwarn = nextwarn - dtime - timer = timer - dtime - if timer > 0 then return end - timer = 4 - local curtime = minetest.get_timeofday() - if math_abs(curtime - fixedtime) > 0.001 then - warn(curtime) - minetest.set_timeofday(fixedtime) - end - end) +minetest.register_globalstep(function() minetest.set_timeofday(0.2) end) minetest.unregister_chatcommand("time")