diff --git a/libraries/AP_Mission/AP_Mission.cpp b/libraries/AP_Mission/AP_Mission.cpp index c55cc2da89..e3da3b6b66 100644 --- a/libraries/AP_Mission/AP_Mission.cpp +++ b/libraries/AP_Mission/AP_Mission.cpp @@ -1002,8 +1002,7 @@ bool AP_Mission::advance_current_nav_cmd() } // search until we find next nav command or reach end of command list - uint8_t max_loops = 64; - while (!_flags.nav_cmd_loaded && --max_loops) { + while (!_flags.nav_cmd_loaded) { // get next command if (!get_next_cmd(cmd_index, cmd, true)) { return false; @@ -1029,11 +1028,6 @@ bool AP_Mission::advance_current_nav_cmd() cmd_index = cmd.index+1; } - if (max_loops == 0) { - // the mission is looping - return false; - } - // if we got this far we must have successfully advanced the nav command return true; }