Comparison

util/timer.lua @ 1871:838d1317bca4

util.timer: Pass current_time to timer callbacks
author Matthew Wild <mwild1@gmail.com>
date Sat, 03 Oct 2009 02:33:33 +0100
parent 1523:841d61be198f
child 2095:3256c5d00901
child 2923:b7049746bd29
comparison
equal deleted inserted replaced
1870:5b5e4a4ecb55 1871:838d1317bca4
40 40
41 for i, d in pairs(data) do 41 for i, d in pairs(data) do
42 local t, func = d[1], d[2]; 42 local t, func = d[1], d[2];
43 if t <= current_time then 43 if t <= current_time then
44 data[i] = nil; 44 data[i] = nil;
45 local r = func(); 45 local r = func(current_time);
46 if type(r) == "number" then _add_task(r, func); end 46 if type(r) == "number" then _add_task(r, func); end
47 end 47 end
48 end 48 end
49 end); 49 end);
50 50