Skip to content

Commit 6e47ce8

Browse files
authored
Merge pull request #531 from Csantucci/dynbrake-display-fix
Bug fix for https://bugs.launchpad.net/or/+bug/1950578 Dyn Brake setup state not disappearing in cab
2 parents 1f77ce3 + b2affac commit 6e47ce8

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
@@ -509,7 +509,7 @@ public int GearboxGearIndex
509509
}
510510
}
511511

512-
public float LocalDynamicBrakePercent;
512+
public float LocalDynamicBrakePercent = -1;
513513
public float DynamicBrakePercent
514514
{
515515
get
@@ -536,6 +536,8 @@ public float DynamicBrakePercent
536536
Train.MUDynamicBrakePercent = value;
537537
else
538538
LocalDynamicBrakePercent = value;
539+
if (Train != null && this == Train.LeadLocomotive)
540+
LocalDynamicBrakePercent = value;
539541
}
540542
}
541543
public Direction Direction

Source/RunActivity/Viewer3D/RollingStock/MSTSLocomotiveViewer.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1947,7 +1947,10 @@ public int GetDrawIndex()
19471947
if (Locomotive.DynamicBrakeController != null)
19481948
{
19491949
if (dynBrakePercent == -1)
1950+
{
1951+
index = 0;
19501952
break;
1953+
}
19511954
if (!Locomotive.HasSmoothStruc)
19521955
{
19531956
index = Locomotive.DynamicBrakeController != null ? Locomotive.DynamicBrakeController.CurrentNotch : 0;

0 commit comments

Comments
 (0)