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:14:13 -04:00
committed by Daniel Agar
parent a71cf21c28
commit 113982e3e7
@@ -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