Attach to to a station with one train that is set with Self Driving on
Use this code:
local station = component.proxy(component.findComponent(findClass("RailroadStation"))[1])
local train = station:getTrackGraph():getTrains()[1]
event.pull(30) --Delay so that you can open the UI. Can be set lower.
train:setSelfDriving(false) --Causes a crash if the train UI is open when it fires.
4. Run the computer, then open the train's UI and wait until crash.
**Expected behavior**
Expected the train to change modes and update the UI.
Describe the bug If the train's self driving state is changed while the train's UI is open, the game crashes.
SMMDebug_2023-6-12_23-29-10.zip
To Reproduce Steps to reproduce the behavior:
event.pull(30) --Delay so that you can open the UI. Can be set lower. train:setSelfDriving(false) --Causes a crash if the train UI is open when it fires.