Skip to content

Commit 1ddc6f4

Browse files
committed
Automatic merge of T1.5.1-972-g193ebe1d0 and 14 pull requests
- Pull request #799 at dfc715e: Consolidated wind simulation - Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters - Pull request #876 at f92de76: docs: add source for documents previously on website to source Documentation folder - Pull request #882 at 48aa537: Blueprint/train car operations UI window - Pull request #891 at 9a1d6b2: Auto save - Pull request #892 at 1f5ba4c: Signal Function OPP_SIG_ID_TRAINPATH - Pull request #896 at 5866028: First implementation of https://blueprints.launchpad.net/or/+spec/specific-sounds-for-ai-trains - Pull request #900 at c27f32d: DMI updates - Pull request #903 at c296b32: Downloading route content (Github, zip) - Pull request #912 at 0cb07c2: New Triple Valve Features Vol. 2 - Pull request #919 at 26cc6a8: Added mouse wheel support for controls which can be moved by pressing t… - Pull request #922 at abe2e52: Autopilot for timetable mode - Pull request #923 at 4c27204: Add curve squeal to route - Pull request #943 at 50d37b7: Dynamic Brakes Behavior & Display Improvements
16 parents 5048d7d + 193ebe1 + dfc715e + d00beb9 + f92de76 + 48aa537 + 9a1d6b2 + 1f5ba4c + 5866028 + c27f32d + c296b32 + 0cb07c2 + 26cc6a8 + abe2e52 + 4c27204 + 50d37b7 commit 1ddc6f4

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
@@ -2222,13 +2222,18 @@ public virtual int GetDrawIndex()
22222222
Locomotive.DynamicBrakePercent : Locomotive.LocalDynamicBrakePercent;
22232223
if (dynBrakePercent <= 0)
22242224
index = 0;
2225-
else if (!Locomotive.HasSmoothStruc && Locomotive.DynamicBrakeController != null)
2226-
index = Locomotive.DynamicBrakeController.CurrentNotch;
2225+
else if (Locomotive.DynamicBrakeController != null)
2226+
{
2227+
if (!Locomotive.HasSmoothStruc)
2228+
index = Locomotive.DynamicBrakeController.CurrentNotch;
2229+
else
2230+
index = PercentToIndex(Locomotive.DynamicBrakeController.CurrentValue);
2231+
}
22272232
else
22282233
index = PercentToIndex(dynBrakePercent);
22292234
break;
22302235
case CABViewControlTypes.CPH_DISPLAY:
2231-
if (Locomotive.CombinedControlType == MSTSLocomotive.CombinedControl.ThrottleDynamic && Locomotive.DynamicBrakePercent >= 0)
2236+
if (Locomotive.CombinedControlType == MSTSLocomotive.CombinedControl.ThrottleDynamic && Locomotive.DynamicBrakeController?.CurrentValue > 0)
22322237
// 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)
22332238
// This hack returns to code of previous OR versions (e.g. release 1.0).
22342239
// 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
@@ -2238,8 +2243,8 @@ public virtual int GetDrawIndex()
22382243
index = PercentToIndex(Locomotive.GetCombinedHandleValue(false));
22392244
break;
22402245
case CABViewControlTypes.CP_HANDLE:
2241-
if (Locomotive.CombinedControlType == MSTSLocomotive.CombinedControl.ThrottleDynamic && Locomotive.DynamicBrakePercent >= 0
2242-
|| Locomotive.CombinedControlType == MSTSLocomotive.CombinedControl.ThrottleAir && Locomotive.TrainBrakeController.CurrentValue > 0)
2246+
if (Locomotive.CombinedControlType == MSTSLocomotive.CombinedControl.ThrottleDynamic && Locomotive.DynamicBrakeController?.CurrentValue > 0
2247+
|| Locomotive.CombinedControlType == MSTSLocomotive.CombinedControl.ThrottleAir && Locomotive.TrainBrakeController?.CurrentValue > 0)
22432248
index = PercentToIndex(Locomotive.GetCombinedHandleValue(false));
22442249
else
22452250
index = PercentToIndex(Locomotive.GetCombinedHandleValue(false));

0 commit comments

Comments
 (0)