Auto Trash


Allows saving of different logistic request setups Enable autotrash only in certain logistic networks Load your spidertron with different setups with a single click Load one or more preset after respawning Trash unrequested items

Content
3 years ago
0.13 - 1.1
37.5K
Logistic network

b Crash when other mod changes runtime settings via script

3 years ago
The mod LTN - Logistic Train Network (1.15.0) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event LogisticTrainNetwork::ltn-toggle-dispatcher (ID 174)
The mod Auto Trash (5.3.12) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event AutoTrash::on_runtime_mod_setting_changed (ID 59)
__AutoTrash__/control.lua:465: bad argument #2 of 2 to 'get_player' (string expected, got nil)
stack traceback:
    [C]: in function 'get_player'
    __AutoTrash__/control.lua:465: in function <__AutoTrash__/control.lua:459>
stack traceback:
    [C]: in function '__newindex'
    __LogisticTrainNetwork__/script/hotkey-events.lua:13: in function <__LogisticTrainNetwork__/script/hotkey-events.lua:8>

This issue only occurs if the mod LTN - Logistic Train Network is enabled as well. (Really any mod that changes settings via script.)

A brand new start of a game (1.1) with only LTN and Auto Trash mods. Simply hitting Ctrl-Shift-D to disable the dispatcher will trigger the crash.

This initially occurred in a late-mid game with several mods and all the relevant techs researched. Distilled it down and tested with Auto Trash and LTN individually. Neither crash by themselves. The crash only occurs when both mods are enabled.

https://lua-api.factorio.com/1.1.19/events.html#on_runtime_mod_setting_changed indicates that e.player_index is expected to be nil if a script changes the setting.

on_runtime_mod_setting_changed
Called when a runtime mod setting is changed by a player.

Contains
player_index :: uint (optional): The player who changed the setting or nil if changed by script.
setting :: string: The setting name that changed.
setting_type :: string: The setting type: "runtime-per-user", or "runtime-global".

3 years ago
(updated 3 years ago)

Thanks for the report, should be fixed in the latest version

New response