Skip to content

Commit 906f204

Browse files
committed
Don't throw errors on cars with no axles
1 parent d36c372 commit 906f204

File tree

1 file changed

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

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2915,7 +2915,8 @@ public void SetUpWheels()
29152915
SetUpWheelsArticulation(articFront, articRear);
29162916

29172917
// Other calculations require axles to be sorted based on their Z-offset
2918-
WheelAxles.Sort(WheelAxles[0]);
2918+
if (WheelAxles.Count > 0)
2919+
WheelAxles.Sort(WheelAxles[0]);
29192920

29202921
// After all processing is complete, check if the car can have its position calculated
29212922
// using the position of the axles, which is indicated by the 'WheelAxlesLoaded' flag.

0 commit comments

Comments
 (0)