mirror of
https://github.com/Refactorio/RedMew.git
synced 2024-12-12 10:04:40 +02:00
switched ipairs to normal for loop
This commit is contained in:
parent
d07458bc84
commit
adb8936cd0
@ -18,11 +18,13 @@ local script_on_nth_tick = script.on_nth_tick
|
|||||||
|
|
||||||
local function call_handlers(handlers, event)
|
local function call_handlers(handlers, event)
|
||||||
if _DEBUG then
|
if _DEBUG then
|
||||||
for _, handler in ipairs(handlers) do
|
for i = 1, #handlers do
|
||||||
|
local handler = handlers[i]
|
||||||
handler(event)
|
handler(event)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
for _, handler in ipairs(handlers) do
|
for i = 1, #handlers do
|
||||||
|
local handler = handlers[i]
|
||||||
local success, error = pcall(handler, event)
|
local success, error = pcall(handler, event)
|
||||||
if not success then
|
if not success then
|
||||||
log(error)
|
log(error)
|
||||||
|
Loading…
Reference in New Issue
Block a user