16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-18 03:09:18 +02:00

Repair of St133 drivers' valve for both player and AI

This commit is contained in:
Królik Uszasty
2021-05-02 23:19:47 +02:00
parent 0ea850314a
commit 939408ec48
2 changed files with 9 additions and 9 deletions

View File

@@ -3215,15 +3215,15 @@ bool TController::DecBrake() {
clamp( -AccDesired / AccMax * mvOccupied->AIHintLocalBrakeAccFactor, 0.0, 1.0 ) ) );
OK = ( mvOccupied->fBrakeCtrlPos != initialbrakeposition );
}
else if( mvOccupied->fBrakeCtrlPos != mvOccupied->Handle->GetPos( bh_EPR ) ) {
mvOccupied->BrakeLevelSet(mvOccupied->Handle->GetPos(bh_EPR));
if( mvOccupied->Handle->GetPos( bh_EPR ) - mvOccupied->Handle->GetPos( bh_EPN ) < 0.1 ) {
mvOccupied->SwitchEPBrake( 1 );
}
OK = true;
}
else {
OK = false;
OK = false;
if (mvOccupied->fBrakeCtrlPos != mvOccupied->Handle->GetPos(bh_EPR)) {
mvOccupied->BrakeLevelSet(mvOccupied->Handle->GetPos(bh_EPR));
OK = true;
}
if (mvOccupied->Handle->GetPos(bh_EPR) - mvOccupied->Handle->GetPos(bh_EPN) < 0.1) {
OK = OK || mvOccupied->SwitchEPBrake(1);
}
}
if( !OK ) {
OK = mvOccupied->DecLocalBrakeLevel( 2 );