diff options
author | Birte Kristina Friesel <derf@finalrewind.org> | 2024-08-11 20:38:51 +0200 |
---|---|---|
committer | Birte Kristina Friesel <derf@finalrewind.org> | 2024-08-11 20:38:51 +0200 |
commit | ea4e39d7b5b6eaa2f2a186fce01010ebb3798eec (patch) | |
tree | a4ed00abfc4f0a10745f4ee41c7714d99933b40e /lib | |
parent | 79832d76067e35736da9d9d912a583a29c2e446d (diff) |
do not pass unsupported mot enums to backends
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Travel/Status/DE/HAFAS/Services.pm.PL | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Travel/Status/DE/HAFAS/Services.pm.PL b/lib/Travel/Status/DE/HAFAS/Services.pm.PL index 00038e5..ae6a754 100644 --- a/lib/Travel/Status/DE/HAFAS/Services.pm.PL +++ b/lib/Travel/Status/DE/HAFAS/Services.pm.PL @@ -40,12 +40,16 @@ sub load_instance { } } + my $skipped = 0; for my $bit ( 0 .. 15 ) { if ( my $p = $bitmask_to_product{ 2**$bit } ) { + for ( 1 .. $skipped ) { + push( @{ $ret{productbits} }, [ "_", undef ] ); + } push( @{ $ret{productbits} }, [ $p->{id}, $p->{name} ] ); } else { - push( @{ $ret{productbits} }, [ "_", undef ] ); + $skipped += 1; } } |