mirror of
https://github.com/vrld/hump.git
synced 2024-11-23 12:24:19 +00:00
Timer - Fixed bug where behaviour of new timers added during iteration through timer handles was indeterminate.
This commit is contained in:
parent
945423f9f5
commit
e62e69999c
@ -32,7 +32,14 @@ local function _nothing_() end
|
|||||||
function Timer:update(dt)
|
function Timer:update(dt)
|
||||||
local to_remove = {}
|
local to_remove = {}
|
||||||
|
|
||||||
|
local handles = {}
|
||||||
|
local len = 0
|
||||||
for handle in pairs(self.functions) do
|
for handle in pairs(self.functions) do
|
||||||
|
len = len + 1
|
||||||
|
handles[len] = handle
|
||||||
|
end
|
||||||
|
|
||||||
|
for _, handle in ipairs(handles) do
|
||||||
-- handle: {
|
-- handle: {
|
||||||
-- time = <number>,
|
-- time = <number>,
|
||||||
-- after = <function>,
|
-- after = <function>,
|
||||||
|
Loading…
Reference in New Issue
Block a user