Commit ef3753ea authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

handle empty Baureihe (e.g. for swiss EC trains)

parent 0892c03c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -134,6 +134,7 @@ for my $wagon ( $wr->wagons ) {
	printf(
		"%3s: %3s %10s  %s\n",
		$wagon->number || '?',
		$wagon->model, $wagon->type, join( q{  }, $wagon->attributes )
		$wagon->model  || '???',
		$wagon->type, join( q{  }, $wagon->attributes )
	);
}
+3 −0
Original line number Diff line number Diff line
@@ -176,6 +176,9 @@ sub train_subtype {
	);

	for my $wagon (@wagons) {
		if ( not $wagon->model ) {
			next;
		}
		if ( $wagon->model == 401
			or ( $wagon->model >= 801 and $wagon->model <= 804 ) )
		{
+1 −1
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@ sub new {
	$ref->{section}       = $opt{fahrzeugsektor};
	$ref->{type}          = $opt{fahrzeugtyp};

	$ref->{model} =~ s{^.....(...)....$}{$1};
	$ref->{model} =~ s{^.....(...)....$}{$1} or $ref->{model} = undef;

	my $self = bless( $ref, $obj );