Skip to content

Commit f9fb52a

Browse files
committed
1 parent 25261e8 commit f9fb52a

File tree

1 file changed

+5
-1
lines changed
  • Source/Orts.Simulation/Simulation/Physics

1 file changed

+5
-1
lines changed

Source/Orts.Simulation/Simulation/Physics/Train.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5596,10 +5596,14 @@ public void UpdateCouplerSlack(float elapsedTime)
55965596
car.CarAhead = null;
55975597
if (Cars.Count > j) // if not a single loco
55985598
{
5599-
if (j != Cars.Count - 1) // if so, this is the last car, and hence no cars behind it
5599+
if (j < Cars.Count - 1) // if > then or =, this is the last car, and hence no further cars behind it
56005600
{
56015601
car.CarBehind = Cars[j + 1];
56025602
}
5603+
else
5604+
{
5605+
car.CarBehind = null;
5606+
}
56035607
}
56045608
else // if a single loco
56055609
{

0 commit comments

Comments
 (0)