Skip to content

Commit

Permalink
mission: reset current sequence to the first item for finished old mi…
Browse files Browse the repository at this point in the history
…ssion
  • Loading branch information
Igor-Misic committed Sep 17, 2021
1 parent 11fb67c commit 27ca85f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/modules/navigator/mission.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,14 @@ Mission::restore_old_mission()
if (valid) {
_mission_changed = true;
_navigator->get_mission_result()->failure = false;
_current_mission_index = _old_mission.current_seq;

/* For completed old mission reset sequence to the first item. */
if (_old_mission.current_seq >= _old_mission.count) {
_current_mission_index = 0;

} else {
_current_mission_index = _old_mission.current_seq;
}

/* lock MISSION_STATE item */
int dm_lock_ret = dm_lock(DM_KEY_MISSION_STATE);
Expand Down

0 comments on commit 27ca85f

Please sign in to comment.