From cbe7bc257ac2eb70fa6dc0d6f002abddb56c1feb Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Wed, 6 Mar 2024 18:03:32 +0100 Subject: Wagon: add group_index accessor --- lib/Travel/Status/DE/DBWagenreihung.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/Travel/Status/DE/DBWagenreihung.pm') diff --git a/lib/Travel/Status/DE/DBWagenreihung.pm b/lib/Travel/Status/DE/DBWagenreihung.pm index 1accece..6f9440c 100644 --- a/lib/Travel/Status/DE/DBWagenreihung.pm +++ b/lib/Travel/Status/DE/DBWagenreihung.pm @@ -694,11 +694,12 @@ sub wagons { } @{ $self->{wagons} }; } - for my $group (@wagon_groups) { - my $tt = $self->wagongroup_subtype( @{$group} ); + for my $i ( 0 .. $#wagon_groups ) { + my $group = $wagon_groups[$i]; + my $tt = $self->wagongroup_subtype( @{$group} ); if ($tt) { for my $wagon ( @{$group} ) { - $wagon->set_traintype($tt); + $wagon->set_traintype( $i, $tt ); } } } -- cgit v1.2.3