get_travel_distance: intermediate: Handle destination renames in sanity check

Also related to #160
This commit is contained in:
Birte Kristina Friesel 2024-08-27 19:06:19 +02:00
parent 39fb04baf0
commit 5192d997de
No known key found for this signature in database
GPG key ID: B63118F7196EA660

View file

@ -1199,7 +1199,12 @@ sub get_travel_distance {
= before_incl { ( $_->[1] and $_->[1] == $to_eva ) or $_->[0] eq $to }
@route;
if ( @route < 2 or $route[-1][0] ne $to ) {
if (
@route < 2
or ( $route[-1][0] ne $to
and ( not $route[-1][1] or $route[-1][1] != $to_eva ) )
)
{
# I AM ERROR
return ( 0, 0, $distance_beeline );