From 7cc6a6739989ec68a0a65e7b5cd479137fa9a0bd Mon Sep 17 00:00:00 2001 From: Ryba04 <71170857+Ryba04@users.noreply.github.com> Date: Tue, 18 Aug 2026 20:34:37 +0200 Subject: [PATCH] Followed sonar's suggestions --- McZapkie/Mover.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/McZapkie/Mover.cpp b/McZapkie/Mover.cpp index c2f27f57..83c918e2 100644 --- a/McZapkie/Mover.cpp +++ b/McZapkie/Mover.cpp @@ -4514,7 +4514,19 @@ void TMoverParameters::UpdatePipePressure(double dt) // (LocalBrakePosAEIM). When SplitEDPneumaticBrake is active the dedicated LocalBrake // lever should apply pneumatic pressure on the locomotive directly, bypassing MED. // LocHandleTimeTraxx also bypasses MED, but has 3 positions (brake-hold-unbrake). - double lbpa = LocHandleTimeTraxx ? eim_localbrake : (SplitEDPneumaticBrake ? LocalBrakePosA : 0.0); + double lbpa; + if (LocHandleTimeTraxx) + { + lbpa = eim_localbrake; + } + else if (SplitEDPneumaticBrake) // When LocHandleTimeTraxx and SplitEDPneumaticBrake are both active, lbpa is taken from LocHandleTimeTraxx, which is the desired behavior. + { + lbpa = LocalBrakePosA; + } + else + { + lbpa = 0.0; + } dpLocalValve = LocHandle->GetPF(std::max(lbpa, LocalBrakePosAEIM), Hamulec->GetBCP(), ScndPipePress, dt, 0); }