Afforess / Factorio-Stdlib

Factorio Standard Library Project
ISC License
162 stars 45 forks source link

Event handler filter is ignored if more than one event ID is specified in `register` #151

Open modo-lv opened 3 years ago

modo-lv commented 3 years ago

Describe the Bug

Event handler filter function is never called if more than one event ID is specified when registering an event.

To Reproduce

Use event.register to define an event handler for more than one event, and also set a filter — the filter is never called.

Save file & Username

No save file, since it's not save-dependent, but here's the code to reproduce:

  events.register(
    {
      defines.events.on_gui_checked_state_changed,
      defines.events.on_gui_selection_state_changed
    },
    function() end,
    function()
      game.print("Testing")
      return true
    end
  )

"Testing" will never get printed. It works fine if only one event ID is specified, without using a table.

Log file

Nothing to log.