diff --git a/ArduPlane/GCS_Mavlink.pde b/ArduPlane/GCS_Mavlink.pde index 82166a03d8..e2315236ea 100644 --- a/ArduPlane/GCS_Mavlink.pde +++ b/ArduPlane/GCS_Mavlink.pde @@ -888,6 +888,7 @@ void GCS_MAVLINK::handle_guided_request(AP_Mission::Mission_Command &cmd) // add home alt if needed if (guided_WP_loc.flags.relative_alt) { guided_WP_loc.alt += home.alt; + guided_WP_loc.flags.relative_alt = 0; } set_mode(GUIDED); @@ -902,11 +903,11 @@ void GCS_MAVLINK::handle_guided_request(AP_Mission::Mission_Command &cmd) */ void GCS_MAVLINK::handle_change_alt_request(AP_Mission::Mission_Command &cmd) { - if (cmd.content.location.flags.relative_alt) { - cmd.content.location.alt += home.alt; - } - next_WP_loc.alt = cmd.content.location.alt; + if (cmd.content.location.flags.relative_alt) { + next_WP_loc.alt += home.alt; + } + next_WP_loc.flags.relative_alt = false; } diff --git a/ArduPlane/commands.pde b/ArduPlane/commands.pde index 37030007f3..9da6a7192f 100644 --- a/ArduPlane/commands.pde +++ b/ArduPlane/commands.pde @@ -26,6 +26,7 @@ static void set_next_WP(const struct Location& loc) if (next_WP_loc.alt == 0) { next_WP_loc.alt = current_loc.alt; next_WP_loc.flags.relative_alt = false; + next_WP_loc.flags.terrain_alt = false; } }