Skip to content

Commit 80b98a3

Browse files
committed
Correct an issue with independent brake not working
1 parent e873707 commit 80b98a3

File tree

1 file changed

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

1 file changed

+2
-15
lines changed

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

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -827,9 +827,7 @@ protected static void PropagateBrakeLinePressures(float elapsedClockSeconds, Tra
827827
int last = -1;
828828
train.FindLeadLocomotives(ref first, ref last);
829829
float sumpv = 0;
830-
float summainrespv = 0;
831830
float sumv = 0;
832-
float summainresv = 0;
833831
int continuousFromInclusive = 0;
834832
int continuousToExclusive = train.Cars.Count;
835833
for (int i = 0; i < train.Cars.Count; i++)
@@ -857,21 +855,11 @@ protected static void PropagateBrakeLinePressures(float elapsedClockSeconds, Tra
857855
sumv += brakeSystem.BrakePipeVolumeM3;
858856
sumpv += brakeSystem.BrakePipeVolumeM3 * brakeSystem.BrakeLine2PressurePSI;
859857

860-
summainresv += brakeSystem.BrakePipeVolumeM3;
861-
862-
if (lead != null)
863-
{
864-
summainrespv += brakeSystem.BrakePipeVolumeM3 * lead.MainResPressurePSI;
865-
}
866-
867858
var eng = train.Cars[i] as MSTSLocomotive;
868859
if (eng != null)
869860
{
870861
sumv += eng.MainResVolumeM3;
871862
sumpv += eng.MainResVolumeM3 * eng.MainResPressurePSI;
872-
873-
summainresv += eng.MainResVolumeM3;
874-
summainrespv += eng.MainResVolumeM3 * eng.MainResPressurePSI;
875863
}
876864
}
877865

@@ -922,14 +910,12 @@ protected static void PropagateBrakeLinePressures(float elapsedClockSeconds, Tra
922910
if (sumv > 0)
923911
{
924912
sumpv /= sumv;
925-
summainrespv /= summainresv;
926913
}
927914

928915
if (!train.Cars[continuousFromInclusive].BrakeSystem.FrontBrakeHoseConnected && train.Cars[continuousFromInclusive].BrakeSystem.AngleCockAOpen
929916
|| (continuousToExclusive == train.Cars.Count || !train.Cars[continuousToExclusive].BrakeSystem.FrontBrakeHoseConnected) && train.Cars[continuousToExclusive - 1].BrakeSystem.AngleCockBOpen)
930917
{
931918
sumpv = 0;
932-
summainrespv = 0;
933919
}
934920

935921
// Propagate main reservoir pipe (2) data
@@ -946,7 +932,8 @@ protected static void PropagateBrakeLinePressures(float elapsedClockSeconds, Tra
946932

947933
train.Cars[i].BrakeSystem.BrakeLine2PressurePSI = sumpv;
948934
if (sumpv != 0 && train.Cars[i] is MSTSLocomotive)
949-
(train.Cars[i] as MSTSLocomotive).MainResPressurePSI = summainrespv;
935+
(train.Cars[i] as MSTSLocomotive).MainResPressurePSI = sumpv;
936+
950937
}
951938
else
952939
{

0 commit comments

Comments
 (0)