route_after: handle passing the same stop more than once

This commit is contained in:
Birte Kristina Friesel 2024-05-22 19:08:35 +02:00
parent cd6df2aa9b
commit 4764fd9a6b
No known key found for this signature in database
GPG key ID: 19E6E524EBB177BA

View file

@ -221,8 +221,15 @@ sub postprocess {
if ($is_after) {
push( @route_after, $station );
}
if ( $ret->{dep_name}
and $station->[0] eq $ret->{dep_name} )
# Note that the departure stop may be present more than once in @route,
# e.g. when traveling along ring lines such as S41 / S42 in Berlin.
if (
$ret->{dep_name}
and $station->[0] eq $ret->{dep_name}
and not($station->[2]{sched_dep}
and $station->[2]{sched_dep} < $ret->{sched_dep_ts} )
)
{
$is_after = 1;
if ( @{$station} > 1 and not $dep_info ) {