16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-18 04:19:19 +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
committed by tmj-fstate
parent 750e9a21a6
commit fa9136e333
2 changed files with 9 additions and 9 deletions

View File

@@ -3197,15 +3197,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 );