File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/PowerSupplies Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -1084,8 +1084,9 @@ public void Update(float elapsedClockSeconds)
10841084 Locomotive . PrevMotiveForceN *= - 1f ;
10851085
10861086 if ( ( State == DieselEngineState . Running ) && ( Locomotive . ThrottlePercent > 0 ) )
1087- {
1088- OutputPowerW = ( Locomotive . PrevMotiveForceN > 0 ? Locomotive . PrevMotiveForceN * Locomotive . AbsSpeedMpS : 0 ) / Locomotive . DieselEngines . NumOfActiveEngines ;
1087+ {
1088+ var abstempMotiveForce = Math . Abs ( Locomotive . PrevMotiveForceN ) ;
1089+ OutputPowerW = ( abstempMotiveForce > 0 ? abstempMotiveForce * Locomotive . AbsSpeedMpS : 0 ) / Locomotive . DieselEngines . NumOfActiveEngines ;
10891090 }
10901091 else
10911092 {
@@ -1438,7 +1439,8 @@ public void Update(float elapsedClockSeconds)
14381439
14391440 if ( Locomotive . DieselEngines . NumOfActiveEngines > 0 )
14401441 {
1441- CurrentDieselOutputPowerW -= Locomotive . DieselPowerSupply . ElectricTrainSupplyPowerW / Locomotive . DieselEngines . NumOfActiveEngines ;
1442+
1443+ CurrentDieselOutputPowerW = ( CurrentDieselOutputPowerW - Locomotive . DieselPowerSupply . ElectricTrainSupplyPowerW ) / Locomotive . DieselEngines . NumOfActiveEngines ;
14421444 CurrentDieselOutputPowerW = CurrentDieselOutputPowerW < 0f ? 0f : CurrentDieselOutputPowerW ;
14431445 }
14441446
You can’t perform that action at this time.
0 commit comments