Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plane: Change a return statement that is not executed #26698

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions ArduPlane/mode_auto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ bool ModeAuto::_enter()
return false;
}
}

if (plane.quadplane.available() && plane.quadplane.enable == 2) {
plane.auto_state.vtol_mode = true;
} else {
Expand Down Expand Up @@ -126,17 +126,19 @@ void ModeAuto::navigate()
bool ModeAuto::does_auto_navigation() const
{
#if AP_SCRIPTING_ENABLED
return (!plane.nav_scripting_active());
return (!plane.nav_scripting_active());
#else
return true;
#endif
return true;
}

bool ModeAuto::does_auto_throttle() const
{
#if AP_SCRIPTING_ENABLED
return (!plane.nav_scripting_active());
return (!plane.nav_scripting_active());
#else
return true;
#endif
return true;
}

// returns true if the vehicle can be armed in this mode
Expand All @@ -145,7 +147,7 @@ bool ModeAuto::_pre_arm_checks(size_t buflen, char *buffer) const
#if HAL_QUADPLANE_ENABLED
if (plane.quadplane.enabled()) {
if (plane.quadplane.option_is_set(QuadPlane::OPTION::ONLY_ARM_IN_QMODE_OR_AUTO) &&
!plane.quadplane.is_vtol_takeoff(plane.mission.get_current_nav_cmd().id)) {
!plane.quadplane.is_vtol_takeoff(plane.mission.get_current_nav_cmd().id)) {
hal.util->snprintf(buffer, buflen, "not in VTOL takeoff");
return false;
}
Expand Down
Loading