Skip to content

Commit ab753bf

Browse files
committed
Fix blending issue
1 parent 0531e58 commit ab753bf

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Source/Orts.Simulation/Simulation/RollingStocks/MSTSLocomotive.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1835,8 +1835,8 @@ public void DynamicBrakeBlending(float elapsedClockSeconds)
18351835
float threshold = 100;
18361836
if (diff > threshold && DynamicBrakeIntervention < 1)
18371837
DynamicBrakeIntervention = Math.Min(DynamicBrakeIntervention + elapsedClockSeconds, 1);
1838-
else if (diff < -threshold)
1839-
DynamicBrakeIntervention -= elapsedClockSeconds;
1838+
else if (diff < -threshold && DynamicBrakeIntervention > 0.01f)
1839+
DynamicBrakeIntervention = Math.Max(DynamicBrakeIntervention - elapsedClockSeconds, 0.01f);
18401840
}
18411841
else
18421842
{

Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/Brakes/MSTS/AirSinglePipe.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ public override void Update(float elapsedClockSeconds)
591591
{
592592
var requiredBrakeForceN = Math.Min(AutoCylPressurePSI / MaxCylPressurePSI, 1) * Car.MaxBrakeForceN;
593593
var localBrakeForceN = loco.DynamicBrakeForceN + Math.Min(CylPressurePSI / MaxCylPressurePSI, 1) * Car.MaxBrakeForceN;
594-
if (localBrakeForceN > requiredBrakeForceN * 0.85f)
594+
if (localBrakeForceN > requiredBrakeForceN - 0.15f * Car.MaxBrakeForceN)
595595
{
596596
isolateAutoBrake = true;
597597
if (loco.DynamicBrakePartialBailOff)

0 commit comments

Comments
 (0)