Skip to content

Commit

Permalink
[FACTORIO 2.0] Fixes event handler registration
Browse files Browse the repository at this point in the history
2.0 no longer allows assigning values to non-event handlers (1.1
tolerated it, 2.0 throws an error).
  • Loading branch information
hgschmie committed Oct 23, 2024
1 parent 0fcbe67 commit 070cdd7
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions stdlib/event/event.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Event.script = {
on_load = script.on_load,
on_configuration_changed = script.on_configuration_changed,
generate_event_name = script.generate_event_name,
get_event_handler = script.get_event_handler
get_event_handler = script.get_event_handler,
}

local Type = require('__stdlib__/stdlib/utils/type')
Expand All @@ -66,11 +66,6 @@ if not config.skip_script_protections then -- Protections for post and pre regis
error('Detected attempt to add the STDLIB event module after using script.on_event')
end
end
for name in pairs(Event.script) do
_G.script[name] = function()
error('Detected attempt to register an event using script.' .. name .. ' while using the STDLIB event system ')
end
end
end

local bootstrap_events = {
Expand Down

0 comments on commit 070cdd7

Please sign in to comment.