Plane: Use new Location::same_loc_as() function

This commit is contained in:
Nick Exton 2023-03-21 21:18:36 +11:00 committed by Andrew Tridgell
parent 76e8407297
commit 6a2bfeb3dd
1 changed files with 1 additions and 6 deletions

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;