[0.14.21] game.get_event_handler doesn't work
Posted: Mon Jan 16, 2017 11:59 pm
My understanding of the documented behaviour is that this snippet should work:
Instead, you get the error "Unknown custom input name: 0" thrown (the 0 comes from value of defines.events.on_tick)
(as an aside, I think this method should be on the LuaBootstrap object instead for symmetry with where you register the event handler - it would be a breaking change but I'm not sure if anything is using it because of the above issue anyway)
Code: Select all
script.on_event(defines.events.on_tick, function() end);
game.print(tostring(game.get_event_handler(defines.events.on_tick)))
(as an aside, I think this method should be on the LuaBootstrap object instead for symmetry with where you register the event handler - it would be a breaking change but I'm not sure if anything is using it because of the above issue anyway)