Skip to content

Commit

Permalink
Clear schedule of tug after disconnect to avoid crash in get_train_st…
Browse files Browse the repository at this point in the history
…op_trains() when the just-finished train already had that stop in the schedule
  • Loading branch information
shanemadden committed Jul 14, 2018
1 parent 27dedf5 commit 89383e3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1315,6 +1315,8 @@ local function try_build(surface_id, force_id, station_name, station_config, sca
end
-- set the speed to 0 to hopefully kill any extra momentum that other train gave us
builder_loco.train.speed = 0
-- clear the schedule
builder_loco.train.schedule = nil
end
if #builder_loco.train.carriages > 1 then
-- still connected to more than we're expecting, must be a train in front, possibly was just pulling in to this station
Expand Down

0 comments on commit 89383e3

Please sign in to comment.