From 9c852dbe50ec562269b269176c06efb3a65146bd Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Sat, 12 May 2012 21:46:54 +0500 Subject: util.timer: Always pass the current time to timer callbacks. --- util/timer.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/timer.lua b/util/timer.lua index e52a6917..af1e57b6 100644 --- a/util/timer.lua +++ b/util/timer.lua @@ -27,7 +27,7 @@ if not server.event then if delay >= current_time then t_insert(new_data, {delay, callback}); else - local r = callback(); + local r = callback(current_time); if r and type(r) == "number" then return _add_task(r, callback); end @@ -67,7 +67,7 @@ else function _add_task(delay, callback) local event_handle; event_handle = event_base:addevent(nil, 0, function () - local ret = callback(); + local ret = callback(get_time()); if ret then return 0, ret; elseif event_handle then -- cgit v1.2.3