Skip to content

Commit 2451991

Browse files
committed
Fix blending issue
1 parent 22f66dc commit 2451991

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
@@ -1837,8 +1837,8 @@ public void DynamicBrakeBlending(float elapsedClockSeconds)
18371837
float threshold = 100;
18381838
if (diff > threshold && DynamicBrakeIntervention < 1)
18391839
DynamicBrakeIntervention = Math.Min(DynamicBrakeIntervention + elapsedClockSeconds, 1);
1840-
else if (diff < -threshold)
1841-
DynamicBrakeIntervention -= elapsedClockSeconds;
1840+
else if (diff < -threshold && DynamicBrakeIntervention > 0.01f)
1841+
DynamicBrakeIntervention = Math.Max(DynamicBrakeIntervention - elapsedClockSeconds, 0.01f);
18421842
}
18431843
else
18441844
{

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ public override void Update(float elapsedClockSeconds)
603603
{
604604
var requiredBrakeForceN = Math.Min(AutoCylPressurePSI / MaxCylPressurePSI, 1) * Car.MaxBrakeForceN;
605605
var localBrakeForceN = loco.DynamicBrakeForceN + Math.Min(CylPressurePSI / MaxCylPressurePSI, 1) * Car.MaxBrakeForceN;
606-
if (localBrakeForceN > requiredBrakeForceN * 0.85f)
606+
if (localBrakeForceN > requiredBrakeForceN - 0.15f * Car.MaxBrakeForceN)
607607
{
608608
isolateAutoBrake = true;
609609
if (loco.DynamicBrakePartialBailOff)

0 commit comments

Comments
 (0)