Page 1 of 1

include previous train state in on_train_changed_state

Posted: Wed Nov 08, 2017 6:31 pm
by Optera
I need to remove a trains from a global list when they leave a stop (or are switched to manual).
Currently I have to trigger on the states on_the_path, no_path, no_schedule or manual_control producing quite some overhead, or keep all states stored in a trainID indexed table inside the mod.

Having the former state passed along as last_state similar to on_train_created(old_train_id_1) would make working with states a bit simpler.

Even more comfortable for finding stops a train just left would be to include the stop entity as last_stop similar to on_selected_entity_changed( last_entity).

Re: include previous train state in on_train_changed_state

Posted: Sat Nov 11, 2017 5:58 pm
by Rseding91
Ok, I added it for 0.16.