Plane: Use new Location::same_loc_as() function

This commit is contained in:
Nick Exton
2023-04-04 09:40:45 +10:00
committed by Andrew Tridgell
parent 76e8407297
commit 6a2bfeb3dd
+1 -6
View File
@@ -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;