From 80b98a3375ac173ad99016b80303936bbfec6995 Mon Sep 17 00:00:00 2001 From: peternewell Date: Thu, 30 Sep 2021 15:41:30 +1000 Subject: [PATCH] Correct an issue with independent brake not working --- .../SubSystems/Brakes/MSTS/AirSinglePipe.cs | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) 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 834c9761e..7fd2e75a3 100644 --- a/Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/Brakes/MSTS/AirSinglePipe.cs +++ b/Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/Brakes/MSTS/AirSinglePipe.cs @@ -827,9 +827,7 @@ protected static void PropagateBrakeLinePressures(float elapsedClockSeconds, Tra int last = -1; train.FindLeadLocomotives(ref first, ref last); float sumpv = 0; - float summainrespv = 0; float sumv = 0; - float summainresv = 0; int continuousFromInclusive = 0; int continuousToExclusive = train.Cars.Count; for (int i = 0; i < train.Cars.Count; i++) @@ -857,21 +855,11 @@ protected static void PropagateBrakeLinePressures(float elapsedClockSeconds, Tra sumv += brakeSystem.BrakePipeVolumeM3; sumpv += brakeSystem.BrakePipeVolumeM3 * brakeSystem.BrakeLine2PressurePSI; - summainresv += brakeSystem.BrakePipeVolumeM3; - - if (lead != null) - { - summainrespv += brakeSystem.BrakePipeVolumeM3 * lead.MainResPressurePSI; - } - var eng = train.Cars[i] as MSTSLocomotive; if (eng != null) { sumv += eng.MainResVolumeM3; sumpv += eng.MainResVolumeM3 * eng.MainResPressurePSI; - - summainresv += eng.MainResVolumeM3; - summainrespv += eng.MainResVolumeM3 * eng.MainResPressurePSI; } } @@ -922,14 +910,12 @@ protected static void PropagateBrakeLinePressures(float elapsedClockSeconds, Tra if (sumv > 0) { sumpv /= sumv; - summainrespv /= summainresv; } if (!train.Cars[continuousFromInclusive].BrakeSystem.FrontBrakeHoseConnected && train.Cars[continuousFromInclusive].BrakeSystem.AngleCockAOpen || (continuousToExclusive == train.Cars.Count || !train.Cars[continuousToExclusive].BrakeSystem.FrontBrakeHoseConnected) && train.Cars[continuousToExclusive - 1].BrakeSystem.AngleCockBOpen) { sumpv = 0; - summainrespv = 0; } // Propagate main reservoir pipe (2) data @@ -946,7 +932,8 @@ protected static void PropagateBrakeLinePressures(float elapsedClockSeconds, Tra train.Cars[i].BrakeSystem.BrakeLine2PressurePSI = sumpv; if (sumpv != 0 && train.Cars[i] is MSTSLocomotive) - (train.Cars[i] as MSTSLocomotive).MainResPressurePSI = summainrespv; + (train.Cars[i] as MSTSLocomotive).MainResPressurePSI = sumpv; + } else {