diff options
Diffstat (limited to 'lib/Travel')
-rw-r--r-- | lib/Travel/Routing/DE/HAFAS.pm | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/Travel/Routing/DE/HAFAS.pm b/lib/Travel/Routing/DE/HAFAS.pm index 584a3a3..62ec34c 100644 --- a/lib/Travel/Routing/DE/HAFAS.pm +++ b/lib/Travel/Routing/DE/HAFAS.pm @@ -237,13 +237,23 @@ sub mot_mask { if ( my @mots = @{ $self->{exclusive_mots} // [] } ) { $mot_mask = 0; for my $mot (@mots) { - $mot_mask |= 1 << $mot_pos{$mot}; + if ( exists $mot_pos{$mot} ) { + $mot_mask |= 1 << $mot_pos{$mot}; + } + elsif ( $mot =~ m{ ^ \d+ $ }x ) { + $mot_mask |= 1 << $mot; + } } } if ( my @mots = @{ $self->{excluded_mots} // [] } ) { for my $mot (@mots) { - $mot_mask &= ~( 1 << $mot_pos{$mot} ); + if ( exists $mot_pos{$mot} ) { + $mot_mask &= ~( 1 << $mot_pos{$mot} ); + } + elsif ( $mot =~ m{ ^ \d+ $ }x ) { + $mot_mask &= ~( 1 << $mot ); + } } } |