Skip to content

Commit 50d37b7

Browse files
committed
Stop blended braking from showing on dynamic brake indiactors
1 parent e7de35f commit 50d37b7

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

Source/RunActivity/Viewer3D/RollingStock/MSTSLocomotiveViewer.cs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2134,13 +2134,18 @@ public virtual int GetDrawIndex()
21342134
Locomotive.DynamicBrakePercent : Locomotive.LocalDynamicBrakePercent;
21352135
if (dynBrakePercent <= 0)
21362136
index = 0;
2137-
else if (!Locomotive.HasSmoothStruc && Locomotive.DynamicBrakeController != null)
2138-
index = Locomotive.DynamicBrakeController.CurrentNotch;
2137+
else if (Locomotive.DynamicBrakeController != null)
2138+
{
2139+
if (!Locomotive.HasSmoothStruc)
2140+
index = Locomotive.DynamicBrakeController.CurrentNotch;
2141+
else
2142+
index = PercentToIndex(Locomotive.DynamicBrakeController.CurrentValue);
2143+
}
21392144
else
21402145
index = PercentToIndex(dynBrakePercent);
21412146
break;
21422147
case CABViewControlTypes.CPH_DISPLAY:
2143-
if (Locomotive.CombinedControlType == MSTSLocomotive.CombinedControl.ThrottleDynamic && Locomotive.DynamicBrakePercent >= 0)
2148+
if (Locomotive.CombinedControlType == MSTSLocomotive.CombinedControl.ThrottleDynamic && Locomotive.DynamicBrakeController?.CurrentValue > 0)
21442149
// TODO <CSComment> This is a sort of hack to allow MSTS-compliant operation of Dynamic brake indications in the standard USA case with 8 steps (e.g. Dash9)
21452150
// This hack returns to code of previous OR versions (e.g. release 1.0).
21462151
// The clean solution for MSTS compliance would be not to increment the percentage of the dynamic brake at first dynamic brake key pression, so that
@@ -2150,8 +2155,8 @@ public virtual int GetDrawIndex()
21502155
index = PercentToIndex(Locomotive.GetCombinedHandleValue(false));
21512156
break;
21522157
case CABViewControlTypes.CP_HANDLE:
2153-
if (Locomotive.CombinedControlType == MSTSLocomotive.CombinedControl.ThrottleDynamic && Locomotive.DynamicBrakePercent >= 0
2154-
|| Locomotive.CombinedControlType == MSTSLocomotive.CombinedControl.ThrottleAir && Locomotive.TrainBrakeController.CurrentValue > 0)
2158+
if (Locomotive.CombinedControlType == MSTSLocomotive.CombinedControl.ThrottleDynamic && Locomotive.DynamicBrakeController?.CurrentValue > 0
2159+
|| Locomotive.CombinedControlType == MSTSLocomotive.CombinedControl.ThrottleAir && Locomotive.TrainBrakeController?.CurrentValue > 0)
21552160
index = PercentToIndex(Locomotive.GetCombinedHandleValue(false));
21562161
else
21572162
index = PercentToIndex(Locomotive.GetCombinedHandleValue(false));

0 commit comments

Comments
 (0)