AP_Mission: mark mission as changed upon mission clear

This commit is contained in:
Peter Barker 2022-08-04 16:19:27 +10:00 committed by Peter Barker
parent 50fb56a74f
commit c2d91a3bdb
1 changed files with 2 additions and 1 deletions

View File

@ -241,7 +241,7 @@ bool AP_Mission::clear()
} }
// remove all commands // remove all commands
_cmd_total.set_and_save(0); truncate(0);
// clear index to commands // clear index to commands
_nav_cmd.index = AP_MISSION_CMD_INDEX_NONE; _nav_cmd.index = AP_MISSION_CMD_INDEX_NONE;
@ -259,6 +259,7 @@ void AP_Mission::truncate(uint16_t index)
{ {
if ((unsigned)_cmd_total > index) { if ((unsigned)_cmd_total > index) {
_cmd_total.set_and_save(index); _cmd_total.set_and_save(index);
_last_change_time_ms = AP_HAL::millis();
} }
} }