[1.1.68] modding-related bug with un-registering filtered events

This subforum contains all the issues which we already resolved.
Post Reply
Honktown
Smart Inserter
Smart Inserter
Posts: 1026
Joined: Thu Oct 03, 2019 7:10 am
Contact:

[1.1.68] modding-related bug with un-registering filtered events

Post by Honktown »

Expectation: unregistering multiple events at a time with

Code: Select all

local events = {defines.events.on_pre_player_mined_item, defines.events.on_robot_pre_mined}
script.on_event(events, nil)]
would remove event filters, and be the same as de-registering events separately.

What happens: Unregistering multiple events doesn't reset event filters, which triggers a desync error on join.

Code: Select all

  66.888 Error ClientMultiplayerManager.cpp:1103: mod-conditional_event_filter_deregister_many had the following event filters when the map was saved: on_pre_player_mined_item (ID 11) (checksum: 153013950) and on_robot_pre_mined (ID 15) (checksum: 153013950)
  66.888 Error ClientMultiplayerManager.cpp:1110: mod-conditional_event_filter_deregister_many registered the following event filters when the map was loaded: 
  66.888 Error ClientMultiplayerManager.cpp:99: MultiplayerManager failed: "" + multiplayer.script-event-mismatch + "
" + "
mod-conditional_event_filter_deregister_many"
Here are four mods, the only difference is A) whether the de-registering is one-at-a-time or many in a table, and B) whether or not there are filters:
conditional_event_deregister_many_0.0.1.zip
(1.13 KiB) Downloaded 80 times
conditional_event_deregister_ones_0.0.1.zip
(1.13 KiB) Downloaded 63 times
1) Host game, place and mine a stone furnace. 2) second player joins.

Only "conditional_event_filter_deregister_many_0.0.1.zip" produces the desync error. As someone was looking over the code in Discord #mod-making, they mentioned multi-event (de-)registration seems to not touch filters. Note: *registering* a function produces an error, that 'filters can't be used with multiple event registration', but registering nil with many does not produce such error.
I have mods! I guess!
Link

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [1.1.68] modding-related bug with un-registering filtered events

Post by Rseding91 »

Thanks for the report. It's now fixed for the next 1.1.release.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Resolved Problems and Bugs”