version 1.2 | | version 1.3 |
---|
| | |
# are not connected. This can be annoying at times, since many maps use | | # are not connected. This can be annoying at times, since many maps use |
# these objects for decorations. | | # these objects for decorations. |
$CONNECTED = 0; | | $CONNECTED = 0; |
$LIB = "/home/hugin/a/crossfire/cf-installroot/share/crossfire"; | | $LIB = "/export/home/crossfire/cf-installroot/share/crossfire"; |
$ARCH = "$LIB/archetypes"; | | $ARCH = "$LIB/archetypes"; |
$FACES = "$LIB/faces"; | | $BMAPS = "$LIB/bmaps"; |
$ANIM = "$LIB/animations"; | | $ANIM = "$LIB/animations"; |
$MAPS = "$LIB/maps"; | | $MAPS = "$LIB/maps"; |
# Set VERBOSE=1 if you want more output | | # Set VERBOSE=1 if you want more output |
$VERBOSE=0; | | $VERBOSE=0; |
| | $SHOW_UNUSED = 0; |
| | |
if (! $ARGV[0]) { | | if (! $ARGV[0]) { |
print "Usage: wanderer.pl map-directory ... > output.log\n"; | | print "Using $MAPS are starting map directory.\n"; |
exit; | | $STARTING = $MAPS; |
| | } else { |
| | $STARTING = $ARGV[0]; |
} | | } |
| | |
| | |
# read filenames to @maps | | # read filenames to @maps |
chdir ($MAPS); | | chdir ($STARTING); |
while ($area = shift) { | | while ($area = shift) { |
&maplist ($area); | | &maplist ($area); |
} | | } |
| | |
| | |
#&print_usage(); | | #&print_usage(); |
| | |
| | if ($SHOW_UNUSED) { |
print " Unused object\n"; | | print " Unused object\n"; |
foreach $a (sort(keys %arches)) { | | foreach $a (sort(keys %arches)) { |
print "$a\n" if (!$objects{$a} && !$players{$a} && !$abilities{$a}) | | print "$a\n" if (!$objects{$a} && !$players{$a} && !$abilities{$a}) |
} | | } |
| | } |
| | |
exit; | | exit; |
| | |
| | |
# print " Closed: ", &obj_name($_), " ($x1,$y1)\n"; | | # print " Closed: ", &obj_name($_), " ($x1,$y1)\n"; |
} else { | | } else { |
# These are currently used be crossfire | | # These are currently used be crossfire |
return if ($to eq "/!"); | | if ($to eq "/!") { # this is a random exit - if we |
| | # have a final map, make sure it |
| | # exists |
| | local ($finalmap) = /^final_map (\S+)$/; |
| | if ($finalmap ne "") { |
| | if ($finalmap =~ m!^/!) { $cdir = "$MAPS"; } |
| | else { ($cdir) = $file =~ m!(.*/)!; } |
| | if (! -f "$cdir$finalmap") { |
| | if ($printmap) { print "$mapname"; $printmap=0;} |
| | print " Missing: ", &obj_name($_), " ($x1,$y1) -> $finalmap ($x,$y)\n"; |
| | } |
| | } |
| | return; |
| | } |
if ($to =~ m!^/!) { | | if ($to =~ m!^/!) { |
$cdir = "$MAPS"; | | $cdir = "$MAPS"; |
} else { | | } else { |
| | |
} | | } |
| | |
sub faces { | | sub faces { |
open(IN, $FACES) || die ("Can't open faces file $FACES\n"); | | open(IN, $BMAPS) || die ("Can't open faces file $BMAPS\n"); |
while (<IN>) { | | while (<IN>) { |
if (/^face (\S+)\s*$/) { | | chomp; |
$faces{$1} = $1; | | ($num, $name) = split; |
} | | $faces{$name} = $name; |
} | | } |
close(IN); | | close(IN); |
} | | } |