From 9ca8aed35c226534805c7431cc3fa36f5741dc6b Mon Sep 17 00:00:00 2001 From: Wouters Dorian Date: Fri, 31 Jul 2015 15:16:10 +0200 Subject: [PATCH] [u_skins] Use minetest.after --- mods/u_skins/u_skins/players.lua | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/mods/u_skins/u_skins/players.lua b/mods/u_skins/u_skins/players.lua index fae667a6..e2a330ed 100755 --- a/mods/u_skins/u_skins/players.lua +++ b/mods/u_skins/u_skins/players.lua @@ -10,15 +10,12 @@ u_skins.load_players = function() end u_skins.load_players() -local ttime = 0 -minetest.register_globalstep(function(t) - ttime = ttime + t - if ttime < 120 then --every 2min' - return - end - ttime = 0 +local function tick() + minetest.after(120, tick) --every 2min' u_skins.save() -end) +end + +minetest.after(120, tick) minetest.register_on_shutdown(function() u_skins.save() end)