Skip to content

Commit 992cc97

Browse files
committed
Prevent compressor sync if MU cable is disconnected
1 parent 4006f8a commit 992cc97

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Source/Orts.Simulation/Simulation/RollingStocks/MSTSLocomotive.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2699,7 +2699,9 @@ protected virtual void UpdateCompressor(float elapsedClockSeconds)
26992699
bool syncCompressor = false;
27002700

27012701
// Compressor synchronization is ignored if 5 psi above the high setpoint
2702-
if (MainResPressurePSI < MaxMainResPressurePSI + 5.0f && LocomotivePowerSupply.AuxiliaryPowerSupplyState == PowerSupplyState.PowerOn)
2702+
// Only accept synchronization if MU cable is connected and locomotive power supply is on
2703+
if (RemoteControlGroup != -1 && MainResPressurePSI < MaxMainResPressurePSI + 5.0f
2704+
&& LocomotivePowerSupply.AuxiliaryPowerSupplyState == PowerSupplyState.PowerOn)
27032705
{
27042706
foreach (List<TrainCar> locoGroup in Train.LocoGroups)
27052707
{
@@ -2708,7 +2710,7 @@ protected virtual void UpdateCompressor(float elapsedClockSeconds)
27082710
foreach (TrainCar locoCar in locoGroup)
27092711
{
27102712
if (locoCar is MSTSLocomotive loco)
2711-
syncCompressor |= (locoGroup.Contains(this as TrainCar) || (CompressorIsMUControlled && loco.CompressorIsMUControlled))
2713+
syncCompressor |= loco.RemoteControlGroup != -1 && (locoGroup.Contains(this as TrainCar) || (CompressorIsMUControlled && loco.CompressorIsMUControlled))
27122714
&& loco.CompressorIsOn && loco.MainResPressurePSI < loco.MaxMainResPressurePSI;
27132715

27142716
// No need to check repeatedly if we already know to sync compressors

0 commit comments

Comments
 (0)