Skip to content
This repository was archived by the owner on Aug 20, 2020. It is now read-only.

Commit f3001af

Browse files
committed
[action_timers] Convert globalstep to minetest.after for #179
1 parent 66c5582 commit f3001af

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

mods/action_timers/init.lua

+6-5
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,15 @@ function action_timers.api.get_timer(name)
4848
return action_timers.timers[name]
4949
end
5050

51-
minetest.register_globalstep(function(dtime)
51+
local function step()
5252
for name, _ in pairs(action_timers.timers) do
53-
action_timers.timers[name] = action_timers.timers[name] - dtime
54-
if action_timers.timers[name] < 0 then
55-
action_timers.timers[name] = 0
53+
if (action_timers.timers[name] > 0) then
54+
action_timers.timers[name] = action_timers.timers[name] - 1
5655
end
5756
end
58-
end)
57+
minetest.after(1, step)
58+
end
59+
minetest.after(0, step)
5960

6061
minetest.log("action", "[ACTimers] Loaded")
6162

0 commit comments

Comments
 (0)