mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-22 07:44:03 -04:00
AP_Mission: rearrange for early-exit if command not found for index
This commit is contained in:
parent
3c3cda81e9
commit
25282c2989
@ -1554,15 +1554,16 @@ void AP_Mission::advance_current_do_cmd()
|
||||
|
||||
// find next do command
|
||||
Mission_Command cmd;
|
||||
if (get_next_do_cmd(cmd_index, cmd)) {
|
||||
// set current do command and start it
|
||||
_do_cmd = cmd;
|
||||
_flags.do_cmd_loaded = true;
|
||||
start_command(_do_cmd);
|
||||
}else{
|
||||
if (!get_next_do_cmd(cmd_index, cmd)) {
|
||||
// set flag to stop unnecessarily searching for do commands
|
||||
_flags.do_cmd_all_done = true;
|
||||
return;
|
||||
}
|
||||
|
||||
// set current do command and start it
|
||||
_do_cmd = cmd;
|
||||
_flags.do_cmd_loaded = true;
|
||||
start_command(_do_cmd);
|
||||
}
|
||||
|
||||
/// get_next_cmd - gets next command found at or after start_index
|
||||
|
Loading…
Reference in New Issue
Block a user