From 4a5c4a518918602c6f4158153b3b6600fd8da120 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 9 Apr 2016 18:48:22 +1000 Subject: [PATCH] Plane: not in vtol mode when quadplane not enabled prevents logging error in auto if quadplane not enabled and running a VTOL mission command --- ArduPlane/quadplane.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ArduPlane/quadplane.cpp b/ArduPlane/quadplane.cpp index 1dc8231399..bad20614d4 100644 --- a/ArduPlane/quadplane.cpp +++ b/ArduPlane/quadplane.cpp @@ -950,7 +950,7 @@ bool QuadPlane::handle_do_vtol_transition(const mavlink_command_long_t &packet) */ bool QuadPlane::in_vtol_auto(void) { - if (plane.control_mode != AUTO) { + if (!enable || plane.control_mode != AUTO) { return false; } if (plane.auto_state.vtol_mode) { @@ -970,6 +970,9 @@ bool QuadPlane::in_vtol_auto(void) */ bool QuadPlane::in_vtol_mode(void) { + if (!enable) { + return false; + } return (plane.control_mode == QSTABILIZE || plane.control_mode == QHOVER || plane.control_mode == QLOITER ||