From d77c8c24798a230f7119efacfbe9d2af53d0228f Mon Sep 17 00:00:00 2001 From: Wouters Dorian Date: Fri, 31 Jul 2015 11:56:19 +0200 Subject: [PATCH] [shutdown] Don't use globalsteps --- mods/shutdown/init.lua | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/mods/shutdown/init.lua b/mods/shutdown/init.lua index b906ef87..9960201d 100755 --- a/mods/shutdown/init.lua +++ b/mods/shutdown/init.lua @@ -28,14 +28,7 @@ end local timer = 0 -minetest.register_globalstep(function(dtime) - timer = timer+dtime - -- if timer < X then = X seconde temps que s'affiche les message - -- Default 300 seconde = 5 minute - if timer < 60 then - return - end - timer = 0 +local function tick() local heure = os.date("%H") local minute = os.date("%M") -- Warn every days @@ -59,4 +52,7 @@ minetest.register_globalstep(function(dtime) -- minetest.request_shutdown() end end -end) + minetest.after(60, tick) +end + +tick()