diff --git a/noinfo/make-indxal4.pl b/noinfo/make-indxal4.pl index de5cbd065..364616876 100755 --- a/noinfo/make-indxal4.pl +++ b/noinfo/make-indxal4.pl @@ -502,39 +502,51 @@ sub parse_csv { # 2nd arg - the entrance of the cave to which the link goes # Returns nothing sub do_link_ent { - my $linkfile = $_[0]; - my $linkent = $_[1]; - my $linkname = $_[2]; - my $storedoffset; + my $linkfile = $_[0]; + my $linkent = $_[1]; + my $linkname = $_[2]; + my $storedoffset; - $storedoffset = tell(CSV); - seek(CSV, 0, 0); + $storedoffset = tell(CSV); + seek(CSV, 0, 0); - while () { - chomp; - if (grep(/,\"$linkfile\",/, $_)) { - if ((&parse_csv($_))[5] eq $linkfile) { - - if ((&parse_csv($_))[4] eq "yes") { - while ((&parse_csv($_))[2] ne $linkent) { - $_ = ; - chomp; - if ((&parse_csv($_))[4] eq "last entrance" && (&parse_csv($_))[2] ne $linkent) { - print STDERR "Warning: Link entrance for $linkname not found\n\n"; - $warnings = 1; - seek(CSV, $storedoffset, 0); - return; - } - } - } - - my (undef, undef, undef, undef, undef, undef, undef, undef, undef, undef, undef, undef, undef, undef, undef, undef, undef, undef, undef, undef, undef, undef, undef, undef, undef, $lent_name, $ltag_punkt, $lother_punkt, $ldesc_other_punkt, $lexact_punkt, $lfix_type, $lgpspresa, $lgpspostsa, $lnorthing, $leasting, $laltitude, undef, undef, undef, undef, undef, undef, $lmarking) = &parse_csv($_); - do_ent($ltag_punkt,$lother_punkt,$lexact_punkt,$lgpspostsa,$lgpspresa,$leasting,$lnorthing,$laltitude,$lent_name,$lfix_type,$ldesc_other_punkt, $lmarking); - seek(CSV, $storedoffset, 0); - return; - } - } - } + while () { + chomp; + if ((&parse_csv($_))[5] eq $linkfile) { + if ((&parse_csv($_))[4] eq "yes") { + while ((&parse_csv($_))[2] ne $linkent) { + $_ = ; + chomp; + if ((&parse_csv($_))[4] eq +"last entrance" && (&parse_csv($_))[2] ne $linkent) { + print STDERR "Warning: +Link entrance for $linkname not found, please specify Link +Entrance\n\n"; + $warnings = 1; + seek(CSV, $storedoffset, 0); + return; + } + } + } + + my (undef, undef, undef, undef, undef, undef, +undef, undef, undef, undef, undef, undef, undef, undef, undef, undef, +undef, undef, undef, undef, undef, undef, undef, undef, undef, +$lent_name, $ltag_punkt, $lother_punkt, $ldesc_other_punkt, +$lexact_punkt, $lfix_type, $lgpspresa, $lgpspostsa, $lnorthing, +$leasting, $laltitude, undef, undef, undef, undef, undef, undef, +$lmarking) = &parse_csv($_); + +do_ent($ltag_punkt,$lother_punkt,$lexact_punkt,$lgpspostsa,$lgpspresa,$leasting,$lnorthing,$laltitude,$lent_name,$lfix_type,$ldesc_other_punkt, +$lmarking); + seek(CSV, $storedoffset, 0); + return; + } + } + print STDERR "Warning: Link file for $linkname not found\n\n"; + $warnings = 1; + seek(CSV, $storedoffset, 0); + return; } # Process the location data for the entrance