Skip to content

Commit 6cf8c3e

Browse files
committed
Improve addition of fake axles
1 parent a984e3f commit 6cf8c3e

File tree

1 file changed

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

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2807,9 +2807,9 @@ public void SetUpWheels()
28072807
// No axles but we have bogies.
28082808
if (WheelAxles.Count == 0 && Parts.Count > 1)
28092809
{
2810-
// Fake the axles by pretending each has 1 axle.
2811-
foreach (var part in Parts)
2812-
WheelAxles.Add(new WheelAxle(part.OffsetM, part.iMatrix, 0));
2810+
// Fake the axles by pretending each bogie has 1 axle.
2811+
for (int i = 1; i < Parts.Count; i++)
2812+
WheelAxles.Add(new WheelAxle(Parts[i].OffsetM, i, Parts[i].iMatrix));
28132813
Trace.TraceInformation("Wheel axle data faked based on {1} bogies for {0}", WagFilePath, Parts.Count - 1);
28142814
}
28152815
bool articFront = !WheelAxles.Any(a => a.OffsetM.Z < 0);

0 commit comments

Comments
 (0)