From 6a2bfeb3ddba60a6cf3740484ea2ef4e49e8d32e Mon Sep 17 00:00:00 2001 From: Nick Exton Date: Tue, 21 Mar 2023 21:18:36 +1100 Subject: [PATCH] Plane: Use new Location::same_loc_as() function --- ArduPlane/ArduPlane.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/ArduPlane/ArduPlane.cpp b/ArduPlane/ArduPlane.cpp index a724c4af4a..d832d8fed3 100644 --- a/ArduPlane/ArduPlane.cpp +++ b/ArduPlane/ArduPlane.cpp @@ -821,12 +821,7 @@ bool Plane::get_target_location(Location& target_loc) */ bool Plane::update_target_location(const Location &old_loc, const Location &new_loc) { - if (!old_loc.same_latlon_as(next_WP_loc)) { - return false; - } - ftype alt_diff; - if (!old_loc.get_alt_distance(next_WP_loc, alt_diff) || - !is_zero(alt_diff)) { + if (!old_loc.same_loc_as(next_WP_loc)) { return false; } next_WP_loc = new_loc;