mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-21 13:02:25 +08:00
Mission: don't do anything in set_current_mission_index() when index=current already
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
committed by
Daniel Agar
parent
6f87a4546d
commit
bd1b0cab73
@@ -307,8 +307,10 @@ Mission::on_active()
|
||||
bool
|
||||
Mission::set_current_mission_index(uint16_t index)
|
||||
{
|
||||
if (_navigator->get_mission_result()->valid &&
|
||||
(index != _current_mission_index) && (index < _mission.count)) {
|
||||
if (index == _current_mission_index) {
|
||||
return true; // nothing to do, so return true
|
||||
|
||||
} else if (_navigator->get_mission_result()->valid && (index < _mission.count)) {
|
||||
|
||||
_current_mission_index = index;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user