summaryrefslogtreecommitdiff
path: root/lib/Travelynx.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Travelynx.pm')
-rwxr-xr-xlib/Travelynx.pm25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/Travelynx.pm b/lib/Travelynx.pm
index 36824c3..b4a9e06 100755
--- a/lib/Travelynx.pm
+++ b/lib/Travelynx.pm
@@ -2136,6 +2136,31 @@ sub startup {
my $to_index
= first_index { $_->[2] and $_->[2] == $to_eva } @polyline;
+ # Work around inconsistencies caused by a multiple EVA IDs mapping to the same station name
+ if ( $from_index == -1 ) {
+ for my $entry ( @{ $journey->{route} // [] } ) {
+ if ( $entry->[0] eq $journey->{from_name} ) {
+ $from_eva = $entry->[1];
+ $from_index
+ = first_index { $_->[2] and $_->[2] == $from_eva }
+ @polyline;
+ last;
+ }
+ }
+ }
+
+ if ( $to_index == -1 ) {
+ for my $entry ( @{ $journey->{route} // [] } ) {
+ if ( $entry->[0] eq $journey->{to_name} ) {
+ $to_eva = $entry->[1];
+ $to_index
+ = first_index { $_->[2] and $_->[2] == $to_eva }
+ @polyline;
+ last;
+ }
+ }
+ }
+
if ( $from_index == -1
or $to_index == -1 )
{