--- deliantra/server/lib/collect.pl.in 2007/01/02 22:27:24 1.4 +++ deliantra/server/lib/collect.pl.in 2007/02/08 02:21:18 1.5 @@ -234,12 +234,11 @@ line: while() { chop; ($var,@values) = split; - if ($var eq "#") { + if ($var =~ /^\s*(?:#?.*|)$/) { #developper comment, switch to next line $commentNum++; next line; - } - if ($var eq "Object") { + } elsif ($var eq "Object") { $lface[0] = ""; $#lface = 0; $lfg = ""; @@ -250,8 +249,7 @@ $walkon = 0; $nopick = 0; $arch = join "_", @values; - } - if ($var eq "end") { + } elsif ($var eq "end") { if ($#lface !=0) { $#lface--; foreach $face (@lface) { @@ -261,28 +259,22 @@ if ($walkon && !$nopick) { &warn("File $arch has an object with walk_on set which can be picked up\n"); } - } # Process the color/face info now - if ($var eq "color_fg") { + } elsif ($var eq "color_fg") { $lfg = $values[0]; next line; - } - if ($var eq "color_bg") { + } elsif ($var eq "color_bg") { $lbg = $values[0]; next line; - } - if ($var eq "end") { + } elsif ($var eq "end") { print ARCH "editor_folder $pathto\n" if $pathto ne ""; - } - if ($var eq "visibility") { + } elsif ($var eq "visibility") { $lvis = $values[0]; next line; - } - if ($var eq "magicmap") { + } elsif ($var eq "magicmap") { $mm = $values[0]; next line; - } - if ($var eq "attacktype") { + } elsif ($var eq "attacktype") { $at = 0; foreach $t ( @values ) { if ( $t =~ /^\d+$/ ) { @@ -296,21 +288,17 @@ } } $_ = $var . ' ' . $at; - } - if ($var eq "is_floor") { + } elsif ($var eq "is_floor") { $floor = $values[0]; # is_floor is also needed for archs, so let it pass # through - } - elsif ($var eq "no_pick") { + } elsif ($var eq "no_pick") { $nopick = $values[0]; } elsif ($var eq "walk_on") { $walkon = $values[0]; - } - elsif ($var eq "face") { + } elsif ($var eq "face") { $lface[$#lface++] = $values[0] - } - elsif ($var eq "anim") { + } elsif ($var eq "anim") { if ($anim{$arch}) { &warn("$arch is a duplicate animation name"); $anim{$arch}=""; @@ -330,11 +318,9 @@ } print ARCH "animation $arch\n"; next line; # don't want the mina - } - if ($var eq "face" && ! $faces{$values[0]}) { + } elsif ($var eq "face" && ! $faces{$values[0]}) { &warn($arch." is missing face ".$values[0]) - } - if ($var eq "smoothface") { + } elsif ($var eq "smoothface") { if ($smoothing{$values[0]} && ($smoothing{$values[0]} ne $values[1])) { &warn($arch." duplicate smoothface for ".$values[0].": ".$smoothing{$values[0]}." and ".$values[1]); } elsif ( ($values[0] eq "") || ($values[1] eq "")) {