diff --git a/ArduPlane/ArduPlane.cpp b/ArduPlane/ArduPlane.cpp index 0181f392d804b..5f1a6e5717b84 100644 --- a/ArduPlane/ArduPlane.cpp +++ b/ArduPlane/ArduPlane.cpp @@ -859,7 +859,7 @@ bool Plane::set_target_location(const Location &target_loc) return false; } // add home alt if needed - if (loc.relative_alt) { + if (loc.relative_alt && !loc.terrain_alt) { loc.alt += plane.home.alt; loc.relative_alt = 0; } diff --git a/ArduPlane/GCS_Mavlink.cpp b/ArduPlane/GCS_Mavlink.cpp index 45f8c3338eedf..591f40d68b810 100644 --- a/ArduPlane/GCS_Mavlink.cpp +++ b/ArduPlane/GCS_Mavlink.cpp @@ -749,7 +749,7 @@ bool GCS_MAVLINK_Plane::handle_guided_request(AP_Mission::Mission_Command &cmd) void GCS_MAVLINK_Plane::handle_change_alt_request(AP_Mission::Mission_Command &cmd) { plane.next_WP_loc.alt = cmd.content.location.alt; - if (cmd.content.location.relative_alt) { + if (cmd.content.location.relative_alt && !cmd.content.location.terrain_alt) { plane.next_WP_loc.alt += plane.home.alt; } plane.next_WP_loc.relative_alt = false; diff --git a/ArduPlane/mode_guided.cpp b/ArduPlane/mode_guided.cpp index a97bedcd7dffb..cb4a1ccd4baa4 100644 --- a/ArduPlane/mode_guided.cpp +++ b/ArduPlane/mode_guided.cpp @@ -109,7 +109,7 @@ void ModeGuided::navigate() bool ModeGuided::handle_guided_request(Location target_loc) { // add home alt if needed - if (target_loc.relative_alt) { + if (target_loc.relative_alt && !target_loc.terrain_alt) { target_loc.alt += plane.home.alt; target_loc.relative_alt = 0; }