diff --git a/Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/Brakes/MSTS/AirSinglePipe.cs b/Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/Brakes/MSTS/AirSinglePipe.cs index e128a1e7a3..7eaa3f4779 100644 --- a/Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/Brakes/MSTS/AirSinglePipe.cs +++ b/Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/Brakes/MSTS/AirSinglePipe.cs @@ -1471,9 +1471,9 @@ protected static void PropagateBrakeLinePressures(float elapsedClockSeconds, Tra { // Only sync application/release on DP units if both the lead unit AND the DP lead unit are set to synchronize // Lead locomotive will always be allowed to apply/release - bool syncApplication = loco == lead ? true : loco.DPSyncTrainApplication && lead.DPSyncTrainApplication; - bool syncRelease = loco == lead ? true : loco.DPSyncTrainRelease && lead.DPSyncTrainRelease; - bool syncEmergency = loco == lead ? true : loco.DPSyncEmergency && lead.DPSyncEmergency; + bool syncApplication = loco == lead || loco.DPSyncTrainApplication && lead.DPSyncTrainApplication; + bool syncRelease = loco == lead || loco.DPSyncTrainRelease && lead.DPSyncTrainRelease; + bool syncEmergency = loco == lead || loco.DPSyncEmergency && lead.DPSyncEmergency; tempBrakePipeFlow = 0.0f; @@ -1699,7 +1699,7 @@ protected static void PropagateBrakeLinePressures(float elapsedClockSeconds, Tra MSTSLocomotive leadLoco = train.DPLeadUnits[i] as MSTSLocomotive; BrakeSystem locoBrakeSystem = train.DPLeadUnits[i].BrakeSystem; - bool syncIndependent = leadLoco == lead ? true : leadLoco.DPSyncIndependent && lead.DPSyncIndependent; + bool syncIndependent = lead != null && (leadLoco == lead || (leadLoco.DPSyncIndependent && lead.DPSyncIndependent)); // Set loco brake pressure on all units with brakes cut in // Only set loco brake pressure on DP units if lead loco AND DP loco are equipped to synchronize braking