The 'on_runtime_mod_setting_changed' event may include a nil value for 'event.player_index', which can result in a non-recoverable error when starting a new game.
I specifically observed this issue with the Project Cybersyn mod (version 1.2.13) installed.
The following series of events occurs:
A new game is started.
Cybersyn changes one of its own settings in its 'on_init' function.
An 'on_runtime_mod_setting_changed' event is dispatched (with a nil player_index).
The 'update_item_count_settings' function runs, and attempts to index an array with the nil player_index; this raises an Exception.
Stdlib re-raises the Exception as a non-recoverable error, since no player has been added to the game yet.
By moving the array index statement into the existing if-statement's scope, we can ensure that player_index is not nil (since Picker Inventory Tools is the only mod that should modify the 'picker-item-count' setting).
The 'on_runtime_mod_setting_changed' event may include a nil value for 'event.player_index', which can result in a non-recoverable error when starting a new game.
I specifically observed this issue with the Project Cybersyn mod (version 1.2.13) installed.
The following series of events occurs:
By moving the array index statement into the existing if-statement's scope, we can ensure that player_index is not nil (since Picker Inventory Tools is the only mod that should modify the 'picker-item-count' setting).