[2.0.66] event state 'wait_station' never fired when changing schedule in an event handler
Posted: Sat Sep 13, 2025 5:44 am
I have two mods. Let's call them "Logistic Train Network" and "Train Tracker". Both listen to `on_train_changed_state`.
When a train stops at a station (transition from `arrive_station` to `wait_station`), the first mod (Logistic Train Network) receives an event with `old_state` = 5 (arrive_station) and train.state == 6 (wait_station). At this point, the mod resets the schedule of the train wihin the event handler.
Now the second mod does *not* receive the same event (which is what I would have expected), but a different event: `old_state = 5` (arrive_station) (that part is still ok) but the train state is now *also* `arrive_station`, not `wait_station`. The second mod *never* receives an on_train_changed_state event with train.state == 6 (wait_station) even though when polling the train (asking for its state), it will be `wait_station` at some later point. Only the event is never fired for any other mod as soon as one mod modifies the schedule.
I would have expected that event being fired for all mods that will be listening to it, independently what any of the mods does to the schedule.
This seems like a bug to me.
When a train stops at a station (transition from `arrive_station` to `wait_station`), the first mod (Logistic Train Network) receives an event with `old_state` = 5 (arrive_station) and train.state == 6 (wait_station). At this point, the mod resets the schedule of the train wihin the event handler.
Now the second mod does *not* receive the same event (which is what I would have expected), but a different event: `old_state = 5` (arrive_station) (that part is still ok) but the train state is now *also* `arrive_station`, not `wait_station`. The second mod *never* receives an on_train_changed_state event with train.state == 6 (wait_station) even though when polling the train (asking for its state), it will be `wait_station` at some later point. Only the event is never fired for any other mod as soon as one mod modifies the schedule.
I would have expected that event being fired for all mods that will be listening to it, independently what any of the mods does to the schedule.
This seems like a bug to me.