Create train. Add schedule to train. Switch train from manual mode to automatic mode.
on_train_changed_state will now fire twice. The first will correctly include event.old_state == defines.train_state.manual_control and correctly changes the trains current state to on_the_path (or no_path or destination_full if appropriate).
Then on_train_changed_state fires again. This time it incorrectly includes event.old_state == defines.train_state.no_schedule. Not only is this old_state incorrect (for either before or after the previous on_train_changed_state event), but it is also redundant.
This second event should not fire.
[2.0.73] on_train_changed_state fires twice with incorrect info
Re: [2.0.73] on_train_changed_state fires twice with incorrect info
Thanks for the report however this is not a bug. The logic is automatic whenever the state is changed and always correct. If it fires, the state was the old value at some point and since changed.
If you want to get ahold of me I'm almost always on Discord.

