From 65741c7cc129b8b992073fcdcd60cfd449264847 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9sar=20Benito=20Lamata?= Date: Mon, 24 Oct 2022 20:29:40 +0200 Subject: [PATCH] Demand train brake if dynamic brake not available --- .../Simulation/RollingStocks/SubSystems/CruiseControl.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/CruiseControl.cs b/Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/CruiseControl.cs index 99d97a86f9..64cfe0ec01 100644 --- a/Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/CruiseControl.cs +++ b/Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/CruiseControl.cs @@ -1351,7 +1351,8 @@ void SetTrainBrake(ref float brakePercent, float elapsedClockSeconds, float delt { if (deltaSpeedMpS > -SpeedDeltaToEnableFullTrainBrake) { - if (!Locomotive.DynamicBrakeAvailable || deltaSpeedMpS < -SpeedDeltaToEnableTrainBrake) + bool dynamicBrakeAvailable = Locomotive.DynamicBrakeAvailable && Locomotive.LocomotivePowerSupply.DynamicBrakeAvailable && Locomotive.AbsSpeedMpS > Locomotive.DynamicBrakeSpeed1MpS; + if (!dynamicBrakeAvailable || deltaSpeedMpS < -SpeedDeltaToEnableTrainBrake) { CCIsUsingTrainBrake = true; brakePercent = TrainBrakeMinPercentValue - 3.0f + (-deltaSpeedMpS * 10)/SpeedDeltaToEnableTrainBrake;