Plane: Refactored quadplane's SLT_Transition::active_frwd()

This commit is contained in:
George Zogopoulos 2024-10-11 12:25:38 +02:00 committed by Andrew Tridgell
parent 016a81bc14
commit e9cdc46f55
1 changed files with 14 additions and 3 deletions

View File

@ -4374,9 +4374,20 @@ bool SLT_Transition::allow_update_throttle_mix() const
bool SLT_Transition::active_frwd() const
{
return quadplane.assisted_flight && // We need to be in assisted flight...
((transition_state == TRANSITION_AIRSPEED_WAIT) || (transition_state == TRANSITION_TIMER)) // ... and a transition must be active...
&& !quadplane.in_vtol_airbrake(); // ... but not executing an QPOS_AIRBRAKE maneuver during an automated landing.
// We need to be in assisted flight...
if (!quadplane.assisted_flight) {
return false;
}
// ... and a transition must be active...
if (!((transition_state == TRANSITION_AIRSPEED_WAIT) || (transition_state == TRANSITION_TIMER))) {
return false;
}
// ... but not executing a QPOS_AIRBRAKE maneuver during an automated landing.
if (quadplane.in_vtol_airbrake()) {
return false;
}
return true;
}
/*