Skip to content

Commit

Permalink
Demand train brake if dynamic brake not available
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarBLG committed Oct 24, 2022
1 parent 50d4487 commit 65741c7
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -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;
Expand Down

0 comments on commit 65741c7

Please sign in to comment.