diff options
-rw-r--r-- | util/events.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/util/events.lua b/util/events.lua index b1f3811c..704d31a4 100644 --- a/util/events.lua +++ b/util/events.lua @@ -53,7 +53,8 @@ function new() if not h then h = {}; handlers[event] = h; end
local dispatcher = function(data)
for _, handler in ipairs(h) do
- handler(data);
+ local ret = handler(data);
+ if ret ~= nil then return ret; end
end
end;
dispatchers[event] = dispatcher;
@@ -66,7 +67,8 @@ function new() local h = handlers[event];
if h then
for _, handler in ipairs(h) do
- handler(data);
+ local ret = handler(data);
+ if ret ~= nil then return ret; end
end
end
end;
|