Panakotta00 / FicsIt-Networks

Control, Monitor, Manage and Automate your Satisfactory.
https://ficsit.app/mod/FicsItNetworks
GNU General Public License v3.0
161 stars 51 forks source link

Train:setSelfDriving causes crash when UI is open. #262

Closed TheBigBadWolf2 closed 1 year ago

TheBigBadWolf2 commented 1 year ago

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:

  1. Build this computer ...
  2. Attach to to a station with one train that is set with Self Driving on
  3. 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.
Panakotta00 commented 1 year ago

Should be fixed with latest release