Skip to content

Commit 22a5780

Browse files
authored
Merge pull request #453 from Sharpe49/power-supply-fix-tractive-force-eb
Fix tractive force not equal to zero during emergency braking https://bugs.launchpad.net/or/+bug/1940163
2 parents ce3470f + 6e89100 commit 22a5780

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Source/Orts.Simulation/Simulation/RollingStocks/MSTSDieselLocomotive.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ protected override void UpdateTractiveForce(float elapsedClockSeconds, float t,
551551
// Advanced configuration (TF table) - use a user defined tractive force table
552552
// With Simple adhesion apart from correction for rail adhesion, there is no further variation to the motive force.
553553
// With Advanced adhesion the raw motive force is fed into the advanced (axle) adhesion model, and is corrected for wheel slip and rail adhesion
554-
if (LocomotivePowerSupply.MainPowerSupplyOn)
554+
if (LocomotivePowerSupply.MainPowerSupplyOn && Direction != Direction.N)
555555
{
556556
// Appartent throttle setting is a reverse lookup of the throttletab vs rpm, hence motive force increase will be related to increase in rpm. The minimum of the two values
557557
// is checked to enable fast reduction in tractive force when decreasing the throttle. Typically it will take longer for the prime mover to decrease rpm then drop motive force.
@@ -648,6 +648,10 @@ protected override void UpdateTractiveForce(float elapsedClockSeconds, float t,
648648
DieselEngines.HandleEvent(PowerSupplyEvent.StopEngine);
649649
}
650650
}
651+
else
652+
{
653+
TractiveForceN = 0f;
654+
}
651655

652656
if (MaxForceN > 0 && MaxContinuousForceN > 0 && PowerReduction < 1)
653657
{

0 commit comments

Comments
 (0)