16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-22 13:59: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
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 ) ) ); clamp( -AccDesired / AccMax * mvOccupied->AIHintLocalBrakeAccFactor, 0.0, 1.0 ) ) );
OK = ( mvOccupied->fBrakeCtrlPos != initialbrakeposition ); 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 { 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 ) { if( !OK ) {
OK = mvOccupied->DecLocalBrakeLevel( 2 ); OK = mvOccupied->DecLocalBrakeLevel( 2 );

View File

@@ -3135,7 +3135,7 @@ double TSt113::GetPF(double i_bcp, double PP, double HP, double dt, double ep)
BCP = lround(i_bcp); BCP = lround(i_bcp);
EPS = BEP_K[BCP]; EPS = BEP_K[BCP+1];
if (BCP > 0) if (BCP > 0)
BCP = BCP - 1; BCP = BCP - 1;