diff --git a/libraries/AP_Math/location.cpp b/libraries/AP_Math/location.cpp index b5f6f92b95..ec945c5f44 100644 --- a/libraries/AP_Math/location.cpp +++ b/libraries/AP_Math/location.cpp @@ -174,8 +174,8 @@ bool location_sanitize(const struct Location &defaultLoc, struct Location &loc) } // convert relative alt=0 to mean current alt - if (loc.alt == 0 && loc.flags.relative_alt) { - loc.flags.relative_alt = false; + if (loc.alt == 0 && loc.relative_alt) { + loc.relative_alt = false; loc.alt = defaultLoc.alt; has_changed = true; }