mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-22 00:28:30 -04:00
Plane: fixed above_location_current() for non-terrain alt
thanks to Lekston for finding the bug (PR#2610)
This commit is contained in:
parent
3a7cc03f67
commit
8a975015b5
@ -398,8 +398,8 @@ bool Plane::above_location_current(const Location &loc)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
float loc_alt_cm = loc.alt;
|
float loc_alt_cm = loc.alt;
|
||||||
if (!loc.flags.relative_alt) {
|
if (loc.flags.relative_alt) {
|
||||||
loc_alt_cm -= home.alt;
|
loc_alt_cm += home.alt;
|
||||||
}
|
}
|
||||||
return current_loc.alt > loc_alt_cm;
|
return current_loc.alt > loc_alt_cm;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user