Skip to content

Commit 1f27a8b

Browse files
committed
Correct checking of axle numbers
1 parent e1e00aa commit 1f27a8b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Source/Orts.Simulation/Simulation/RollingStocks/MSTSWagon.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2296,11 +2296,16 @@ private void UpdateTrainBaseResistance_DavisLowSpeed()
22962296
// Determine Axle loading of Car
22972297
if (WagonType == WagonTypes.Engine && IsPlayerTrain && Simulator.PlayerLocomotive is MSTSLocomotive locoParameters)
22982298
{
2299+
// This only takes into account the driven axles for 100% accuracy the non driven axles should also be considered
22992300
AxleLoadKg = locoParameters.DrvWheelWeightKg / locoParameters.LocoNumDrvAxles;
23002301
}
23012302
else
23022303
{
2303-
AxleLoadKg = MassKG / WagonNumAxles;
2304+
// Typically this loop should only be processed when it is a car of some descritption, and therefore it will use the wagon axles as it reference.
2305+
if (WagonNumAxles > 0)
2306+
{
2307+
AxleLoadKg = MassKG / WagonNumAxles;
2308+
}
23042309
}
23052310

23062311
// Calculate the track gradient based on wagon axle loading

0 commit comments

Comments
 (0)