18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-20 18:35:00 +01:00

fix: review of the EN57 EP brake (Sonar null check, EP fuse of the cab car, AI re-asserts the EP brake)

- tests: REQUIRE the brake handle before dereferencing it (Sonar cpp:S2259)
- TESt::FillBrakeRes is const (S5817)
- cab EP brake command: drop the mvControlled->EpFuse check, SwitchEPBrake
  already checks the cab car's (mvOccupied) EP fuse with the control supply
- AI: with the handle already at the EP brake position, switch the EP brake
  on again once the control supply is back
This commit is contained in:
jerrrrycho
2026-11-08 17:37:56 +01:00
parent 87f1d960a0
commit 200d3ae73b
5 changed files with 18 additions and 3 deletions

View File

@@ -2235,7 +2235,9 @@ void TTrain::OnCommand_wheelspinbrakeactivate(TTrain *Train, command_data const
// visual feedback
Train->ggAntiSlipButton.UpdateValue(1.0, Train->dsbPneumaticSwitch);
if (Train->mvOccupied->BrakeHandle == TBrakeHandle::St113 && Train->mvControlled->EpFuse == true)
// the EP fuse is the cab car's (Ctrl+Z switches mvOccupied's), checked by SwitchEPBrake with the rest of
// the control's supply
if (Train->mvOccupied->BrakeHandle == TBrakeHandle::St113)
{
Train->mvOccupied->SwitchEPBrake(1);
}