File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Source/Orts.Simulation/Simulation/RollingStocks Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -436,8 +436,8 @@ public virtual void LoadFromWagFile(string wagFilePath)
436
436
}
437
437
}
438
438
439
- // Ensure Drive Axles is set to a default if no OR value added to WAG file
440
- if ( WagonNumAxles == 0 )
439
+ // Ensure Drive Axles is set to a default if no OR value added to WAG file, assumes that WagonNumAxles only needs to be set on non locomotive cars
440
+ if ( WagonNumAxles == 0 && WagonType != WagonTypes . Engine )
441
441
{
442
442
if ( MSTSWagonNumWheels != 0 && MSTSWagonNumWheels < 6 )
443
443
{
@@ -2296,11 +2296,16 @@ private void UpdateTrainBaseResistance_DavisLowSpeed()
2296
2296
// Determine Axle loading of Car
2297
2297
if ( WagonType == WagonTypes . Engine && IsPlayerTrain && Simulator . PlayerLocomotive is MSTSLocomotive locoParameters )
2298
2298
{
2299
+ // This only takes into account the driven axles for 100% accuracy the non driven axles should also be considered
2299
2300
AxleLoadKg = locoParameters . DrvWheelWeightKg / locoParameters . LocoNumDrvAxles ;
2300
2301
}
2301
2302
else
2302
2303
{
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
+ }
2304
2309
}
2305
2310
2306
2311
// Calculate the track gradient based on wagon axle loading
You can’t perform that action at this time.
0 commit comments