diff -r 8c5d945c1f35 -r dffbb7d1da4b util/events.lua --- a/util/events.lua Sun May 17 02:06:35 2009 +0500 +++ b/util/events.lua Sun May 17 04:50:32 2009 +0500 @@ -52,9 +52,9 @@ local function _create_dispatcher(event) -- FIXME duplicate code in fire_event local h = handlers[event]; if not h then h = {}; handlers[event] = h; end - local dispatcher = function(data) + local dispatcher = function(...) for _, handler in ipairs(h) do - local ret = handler(data); + local ret = handler(...); if ret ~= nil then return ret; end end end; @@ -64,11 +64,11 @@ local function get_dispatcher(event) return dispatchers[event] or _create_dispatcher(event); end; - local function fire_event(event, data) -- FIXME duplicates dispatcher code + local function fire_event(event, ...) -- FIXME duplicates dispatcher code local h = handlers[event]; if h then for _, handler in ipairs(h) do - local ret = handler(data); + local ret = handler(...); if ret ~= nil then return ret; end end end