Skip to content

Commit b2affac

Browse files
committed
Bug fix for https://bugs.launchpad.net/or/+bug/1950578 Dyn Brake set up state not disappearing in cab
1 parent 04375e6 commit b2affac

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Source/Orts.Simulation/Simulation/RollingStocks/TrainCar.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ public int GearboxGearIndex
502502
}
503503
}
504504

505-
public float LocalDynamicBrakePercent;
505+
public float LocalDynamicBrakePercent = -1;
506506
public float DynamicBrakePercent
507507
{
508508
get
@@ -527,6 +527,8 @@ public float DynamicBrakePercent
527527
Train.MUDynamicBrakePercent = value;
528528
else
529529
LocalDynamicBrakePercent = value;
530+
if (Train != null && this == Train.LeadLocomotive)
531+
LocalDynamicBrakePercent = value;
530532
}
531533
}
532534
public Direction Direction

Source/RunActivity/Viewer3D/RollingStock/MSTSLocomotiveViewer.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1937,7 +1937,10 @@ public int GetDrawIndex()
19371937
if (Locomotive.DynamicBrakeController != null)
19381938
{
19391939
if (dynBrakePercent == -1)
1940+
{
1941+
index = 0;
19401942
break;
1943+
}
19411944
if (!Locomotive.HasSmoothStruc)
19421945
{
19431946
index = Locomotive.DynamicBrakeController != null ? Locomotive.DynamicBrakeController.CurrentNotch : 0;

0 commit comments

Comments
 (0)