Skip to content

Commit 9da5607

Browse files
committed
Fix original bug
1 parent ce24add commit 9da5607

File tree

1 file changed

+1
-1
lines changed
  • Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/Brakes/MSTS

1 file changed

+1
-1
lines changed

Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/Brakes/MSTS/AirSinglePipe.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1653,7 +1653,7 @@ public override void Update(float elapsedClockSeconds)
16531653
{
16541654
if (loco.Train.LeadLocomotiveIndex >= 0)
16551655
{
1656-
if (loco.Train.DetermineDPLeadLocomotive(loco) is MSTSLocomotive lead && (lead.BailOff || lead.EngineBrakeController.TrainBrakeControllerState == ControllerState.BailOff))
1656+
if (loco.Train.DetermineDPLeadLocomotive(loco) is MSTSLocomotive lead && (lead.BailOff || (lead.EngineBrakeController != null && lead.EngineBrakeController.TrainBrakeControllerState == ControllerState.BailOff)))
16571657
{
16581658
if (loco.BrakeValve == MSTSWagon.BrakeValveType.Distributor)
16591659
{

0 commit comments

Comments
 (0)