Skip to content
Permalink
Browse files

Fix indexing error in timer processing

  • Loading branch information
Zefram sapier
Zefram authored and sapier committed Jul 16, 2014
1 parent 9a016a6 commit aebbcbf398a9dde6b2cbc8ab05c103f44f6f703d
Showing with 5 additions and 1 deletion.
  1. +5 −1 builtin/game/misc.lua
@@ -11,11 +11,15 @@ core.register_globalstep(function(dtime)
table.insert(core.timers, timer)
end
core.timers_to_add = {}
for index, timer in ipairs(core.timers) do
local index = 1
while index <= #core.timers do
local timer = core.timers[index]
timer.time = timer.time - dtime
if timer.time <= 0 then
timer.func(unpack(timer.args or {}))
table.remove(core.timers,index)
else
index = index + 1
end
end
end)

0 comments on commit aebbcbf

Please sign in to comment.
You can’t perform that action at this time.