commander: fix incorrect return in set_link_loss_nav_state()

If both local position and altitude were not valid, then both RC loss and
datalink loss would not trigger any failsafe at all, independently from
the configured action.
This commit is contained in:
Beat Küng
2022-05-06 10:15:30 -04:00
committed by Daniel Agar
parent f8ff34f82d
commit 8cff9a1e04
@@ -755,12 +755,13 @@ void set_link_loss_nav_state(vehicle_status_s &status, actuator_armed_s &armed,
} else {
if (status_flags.local_position_valid) {
status.nav_state = vehicle_status_s::NAVIGATION_STATE_AUTO_LAND;
return;
} else if (status_flags.local_altitude_valid) {
status.nav_state = vehicle_status_s::NAVIGATION_STATE_DESCEND;
return;
}
return;
}
// FALLTHROUGH