diff --git a/McZapkie/Oerlikon_ESt.cpp b/McZapkie/Oerlikon_ESt.cpp index d8d5b3da..8705000a 100644 --- a/McZapkie/Oerlikon_ESt.cpp +++ b/McZapkie/Oerlikon_ESt.cpp @@ -327,7 +327,7 @@ void TNESt3::Init( double const PP, double const HPP, double const LPP, double c double TNESt3::GetRapidRatio(double const Vel) const { // ESt3 has no rapid relay, and with disc brakes the rapid step stays engaged at all speeds - if( ( PrzekRapid == nullptr ) || ( true == RapidStaly ) ) { + if( ( PrzekRapid == nullptr ) || RapidStaly ) { return 1.0; } // a braking vehicle comes from above, so the step is still engaged down to the speed diff --git a/vehicle/Driver.cpp b/vehicle/Driver.cpp index 09b607b6..d75500db 100644 --- a/vehicle/Driver.cpp +++ b/vehicle/Driver.cpp @@ -6672,7 +6672,7 @@ TController::determine_proximity_ranges() { // na jaka odleglosc i z jaka predkoscia ma podjechac do przeszkody // jeśli pociąg if( is_train() ) { - if( true == IsAtPassengerStop ) { + if( IsAtPassengerStop ) { // a stop point keeps the margins its W4 parameters (head or middle of the consist, // platform length) were set up against fMinProximityDist = std::clamp( 5 + iVehicles, 10, 15 ); @@ -7342,7 +7342,7 @@ TController::pick_optimal_speed( double const Range ) { is_car() ? -2.0 : -0.9, is_car() ? 2.0 : 0.9 ); - if( ( true == is_train() ) + if( is_train() && ( ( OrderCurrentGet() & Obey_train ) != 0 ) && ( VelNext == 0.0 ) && ( ActualProximityDist <= fMaxProximityDist ) @@ -7872,7 +7872,7 @@ TController::adjust_desired_speed_for_current_speed() { -0.05 + fAccThreshold, std::max( EU07_AI_NOACCELERATION, AccPreferred ) ) ); // HACK: for cargo trains with high braking threshold ensure we cross that threshold - if( true == IsCargoTrain + if( IsCargoTrain && fBrake_a0[0] > 0.2 && speedestimate > holdlimit ) { AccDesired -= std::clamp( fBrake_a0[ 0 ] - 0.2, 0.0, 0.15 ); diff --git a/vehicle/Driver.h b/vehicle/Driver.h index 0e65a4b9..fefa950c 100644 --- a/vehicle/Driver.h +++ b/vehicle/Driver.h @@ -356,7 +356,7 @@ private: // how far short of a stop the AI aims: in train running the middle of the 8-15 m window before a signal, // otherwise (a W4 stop point, shunting, coupling) half the minimum proximity distance, as before double stopping_margin() const { - return ( ( OrderCurrentGet() & Obey_train ) != 0 ) && ( false == IsAtPassengerStop ) ? + return ( ( OrderCurrentGet() & Obey_train ) != 0 ) && !IsAtPassengerStop ? fMinProximityDist + 3.5 : 0.5 * fMinProximityDist; } void apply_independent_brake_only();