get_user_status: fix stop_before_dest calculation

This commit is contained in:
Birte Kristina Friesel 2023-07-15 19:16:01 +02:00
parent 40cd1d06fe
commit bee67f096a
No known key found for this signature in database
GPG key ID: 19E6E524EBB177BA

View file

@ -1446,10 +1446,18 @@ sub startup {
= scalar @{ $ret->{route_after} }
? $ret->{route_after}[0][0]
: undef;
my $stop_before_dest
= scalar @{ $ret->{route_after} }
? $ret->{route_after}[-1][0]
: undef;
my $stop_before_dest;
for my $i ( 1 .. $#{ $ret->{route_after} } ) {
if ( $ret->{arr_name}
and $ret->{route_after}[$i][0] eq $ret->{arr_name} )
{
$stop_before_dest = $ret->{route_after}[ $i - 1 ][0];
last;
}
}
say $stop_after_dep;
say $stop_before_dest;
my ($dep_platform_number)
= ( ( $ret->{dep_platform} // 0 ) =~ m{(\d+)} );