1
0
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:
grilledham 2019-02-19 17:28:00 +00:00
parent d07458bc84
commit adb8936cd0

View File

@ -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)