ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/lib/collect.pl.in
(Generate patch)

Comparing deliantra/server/lib/collect.pl.in (file contents):
Revision 1.4 by pippijn, Tue Jan 2 22:27:24 2007 UTC vs.
Revision 1.5 by root, Thu Feb 8 02:21:18 2007 UTC

232 } 232 }
233 open(ARC,$arch) || &die("cannot open ".$arch); 233 open(ARC,$arch) || &die("cannot open ".$arch);
234line: while(<ARC>) { 234line: while(<ARC>) {
235 chop; 235 chop;
236 ($var,@values) = split; 236 ($var,@values) = split;
237 if ($var eq "#") { 237 if ($var =~ /^\s*(?:#?.*|)$/) {
238 #developper comment, switch to next line 238 #developper comment, switch to next line
239 $commentNum++; 239 $commentNum++;
240 next line; 240 next line;
241 }
242 if ($var eq "Object") { 241 } elsif ($var eq "Object") {
243 $lface[0] = ""; 242 $lface[0] = "";
244 $#lface = 0; 243 $#lface = 0;
245 $lfg = ""; 244 $lfg = "";
246 $lbg = ""; 245 $lbg = "";
247 $lvis = ""; 246 $lvis = "";
248 $mm = ""; 247 $mm = "";
249 $floor = ""; 248 $floor = "";
250 $walkon = 0; 249 $walkon = 0;
251 $nopick = 0; 250 $nopick = 0;
252 $arch = join "_", @values; 251 $arch = join "_", @values;
253 }
254 if ($var eq "end") { 252 } elsif ($var eq "end") {
255 if ($#lface !=0) { 253 if ($#lface !=0) {
256 $#lface--; 254 $#lface--;
257 foreach $face (@lface) { 255 foreach $face (@lface) {
258 &storeFaceInfo($face, $lfg, $lbg, $lvis,$mm,$floor); 256 &storeFaceInfo($face, $lfg, $lbg, $lvis,$mm,$floor);
259 } 257 }
260 } 258 }
261 if ($walkon && !$nopick) { 259 if ($walkon && !$nopick) {
262 &warn("File $arch has an object with walk_on set which can be picked up\n"); 260 &warn("File $arch has an object with walk_on set which can be picked up\n");
263 } 261 }
264 }
265 # Process the color/face info now 262 # Process the color/face info now
266 if ($var eq "color_fg") { 263 } elsif ($var eq "color_fg") {
267 $lfg = $values[0]; 264 $lfg = $values[0];
268 next line; 265 next line;
269 }
270 if ($var eq "color_bg") { 266 } elsif ($var eq "color_bg") {
271 $lbg = $values[0]; 267 $lbg = $values[0];
272 next line; 268 next line;
273 }
274 if ($var eq "end") { 269 } elsif ($var eq "end") {
275 print ARCH "editor_folder $pathto\n" if $pathto ne ""; 270 print ARCH "editor_folder $pathto\n" if $pathto ne "";
276 }
277 if ($var eq "visibility") { 271 } elsif ($var eq "visibility") {
278 $lvis = $values[0]; 272 $lvis = $values[0];
279 next line; 273 next line;
280 }
281 if ($var eq "magicmap") { 274 } elsif ($var eq "magicmap") {
282 $mm = $values[0]; 275 $mm = $values[0];
283 next line; 276 next line;
284 }
285 if ($var eq "attacktype") { 277 } elsif ($var eq "attacktype") {
286 $at = 0; 278 $at = 0;
287 foreach $t ( @values ) { 279 foreach $t ( @values ) {
288 if ( $t =~ /^\d+$/ ) { 280 if ( $t =~ /^\d+$/ ) {
289 $at |= $t; 281 $at |= $t;
290 } else { 282 } else {
294 &warn($arch . " has invalid attacktype " . $t); 286 &warn($arch . " has invalid attacktype " . $t);
295 } 287 }
296 } 288 }
297 } 289 }
298 $_ = $var . ' ' . $at; 290 $_ = $var . ' ' . $at;
299 }
300 if ($var eq "is_floor") { 291 } elsif ($var eq "is_floor") {
301 $floor = $values[0]; 292 $floor = $values[0];
302 # is_floor is also needed for archs, so let it pass 293 # is_floor is also needed for archs, so let it pass
303 # through 294 # through
304 }
305 elsif ($var eq "no_pick") { 295 } elsif ($var eq "no_pick") {
306 $nopick = $values[0]; 296 $nopick = $values[0];
307 } elsif ($var eq "walk_on") { 297 } elsif ($var eq "walk_on") {
308 $walkon = $values[0]; 298 $walkon = $values[0];
309 }
310 elsif ($var eq "face") { 299 } elsif ($var eq "face") {
311 $lface[$#lface++] = $values[0] 300 $lface[$#lface++] = $values[0]
312 }
313 elsif ($var eq "anim") { 301 } elsif ($var eq "anim") {
314 if ($anim{$arch}) { 302 if ($anim{$arch}) {
315 &warn("$arch is a duplicate animation name"); 303 &warn("$arch is a duplicate animation name");
316 $anim{$arch}=""; 304 $anim{$arch}="";
317 } 305 }
318 while (<ARC>) { 306 while (<ARC>) {
328 } 316 }
329 $anim{$arch} .= "$var\n"; 317 $anim{$arch} .= "$var\n";
330 } 318 }
331 print ARCH "animation $arch\n"; 319 print ARCH "animation $arch\n";
332 next line; # don't want the mina 320 next line; # don't want the mina
333 }
334 if ($var eq "face" && ! $faces{$values[0]}) { 321 } elsif ($var eq "face" && ! $faces{$values[0]}) {
335 &warn($arch." is missing face ".$values[0]) 322 &warn($arch." is missing face ".$values[0])
336 }
337 if ($var eq "smoothface") { 323 } elsif ($var eq "smoothface") {
338 if ($smoothing{$values[0]} && ($smoothing{$values[0]} ne $values[1])) { 324 if ($smoothing{$values[0]} && ($smoothing{$values[0]} ne $values[1])) {
339 &warn($arch." duplicate smoothface for ".$values[0].": ".$smoothing{$values[0]}." and ".$values[1]); 325 &warn($arch." duplicate smoothface for ".$values[0].": ".$smoothing{$values[0]}." and ".$values[1]);
340 } elsif ( ($values[0] eq "") || ($values[1] eq "")) { 326 } elsif ( ($values[0] eq "") || ($values[1] eq "")) {
341 &warn ($arch." incomplete smoothface entry found: ".$values[0]." ".$values[1]); 327 &warn ($arch." incomplete smoothface entry found: ".$values[0]." ".$values[1]);
342 } else { 328 } else {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines