Copter: precland checks get_alt_cm return value
This makes it easier for Covarity to recognise that we don't have an error by checking the return value of get_alt_cm No functional change
This commit is contained in:
parent
83c3659acc
commit
3be76743bf
@ -21,7 +21,9 @@ void Copter::update_precland()
|
||||
if (rangefinder_alt_ok()) {
|
||||
height_above_ground_cm = rangefinder_state.alt_cm;
|
||||
} else if (terrain_use()) {
|
||||
current_loc.get_alt_cm(Location_Class::ALT_FRAME_ABOVE_TERRAIN, height_above_ground_cm);
|
||||
if (!current_loc.get_alt_cm(Location_Class::ALT_FRAME_ABOVE_TERRAIN, height_above_ground_cm)) {
|
||||
height_above_ground_cm = current_loc.alt;
|
||||
}
|
||||
}
|
||||
|
||||
copter.precland.update(height_above_ground_cm);
|
||||
|
Loading…
Reference in New Issue
Block a user