From ed3f47ff187919401663d17204ce720c6fb8e07b Mon Sep 17 00:00:00 2001 From: plague006 Date: Mon, 4 Mar 2019 16:37:32 -0500 Subject: [PATCH] Don't overwrite script.generate_event_name as it errors if given an arg --- utils/event.lua | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/utils/event.lua b/utils/event.lua index 5ab5b8c7..09c7b857 100644 --- a/utils/event.lua +++ b/utils/event.lua @@ -419,14 +419,13 @@ end function Event.generate_event_name(name) local event_id = generate_event_name() - defines.events[name] = event_id -- luacheck: ignore 122 + -- If we're not in debug, we just turn the above function into an alias of script.generate_event_name + if _DEBUG then + defines.events[name] = event_id -- luacheck: ignore 122 + end return event_id end --- If we're not in debug, we just turn the above function into an alias of script.generate_event_name -if not _DEBUG then - Event.generate_event_name = generate_event_name -end local function add_handlers() for event_name, tokens in pairs(token_handlers) do