Skip to content

Commit 94da787

Browse files
authored
Merge pull request #790 from Roeterdink/CrashInTrainCar
Correct crash in TrainCar.cs
2 parents 5d9debb + 36a9921 commit 94da787

File tree

1 file changed

+1
-1
lines changed
  • Source/Orts.Simulation/Simulation/RollingStocks

1 file changed

+1
-1
lines changed

Source/Orts.Simulation/Simulation/RollingStocks/TrainCar.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1768,7 +1768,7 @@ public string GetCurveDirection()
17681768
public virtual void UpdateCurveSpeedLimit()
17691769
{
17701770
float s = AbsSpeedMpS; // speed of train
1771-
var train = Simulator.PlayerLocomotive.Train;//Debrief Eval
1771+
var train = Simulator.PlayerLocomotive != null ? Simulator.PlayerLocomotive.Train : null;//Debrief Eval (timetable train can exist without engine)
17721772

17731773
// get curve radius
17741774

0 commit comments

Comments
 (0)