File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Source/Orts.Simulation/Simulation/RollingStocks Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -483,7 +483,7 @@ public virtual void LoadFromWagFile(string wagFilePath)
483483 }
484484
485485 // Ensure Drive Axles is set to a default if no OR value added to WAG file
486- if ( WagonNumAxles == 0 )
486+ if ( WagonNumAxles == 0 && WagonType != WagonTypes . Engine )
487487 {
488488 if ( MSTSWagonNumWheels != 0 && MSTSWagonNumWheels < 6 )
489489 {
@@ -2409,11 +2409,16 @@ private void UpdateTrainBaseResistance_DavisLowSpeed()
24092409 // Determine Axle loading of Car
24102410 if ( WagonType == WagonTypes . Engine && IsPlayerTrain && Simulator . PlayerLocomotive is MSTSLocomotive locoParameters )
24112411 {
2412+ // This only takes into account the driven axles for 100% accuracy the non driven axles should also be considered
24122413 AxleLoadKg = locoParameters . DrvWheelWeightKg / locoParameters . LocoNumDrvAxles ;
24132414 }
24142415 else
24152416 {
2416- AxleLoadKg = MassKG / WagonNumAxles ;
2417+ // Typically this loop should only be processed when it is a car of some description, and therefore it will use the wagon axles as it reference.
2418+ if ( WagonNumAxles > 0 )
2419+ {
2420+ AxleLoadKg = MassKG / WagonNumAxles ;
2421+ }
24172422 }
24182423
24192424 // Calculate the track gradient based on wagon axle loading
You can’t perform that action at this time.
0 commit comments