ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra/Deliantra.pm
(Generate patch)

Comparing deliantra/Deliantra/Deliantra.pm (file contents):
Revision 1.45 by root, Thu Mar 16 01:13:02 2006 UTC vs.
Revision 1.46 by root, Thu Mar 16 01:34:01 2006 UTC

305 import 305 import
306 306
307=cut 307=cut
308 308
309sub arch_attr($) { 309sub arch_attr($) {
310 my ($arch) = @_; 310 my ($obj) = @_;
311 311
312 require Crossfire::Data; 312 require Crossfire::Data;
313 313
314 my $root; 314 my $root;
315
316 my $arch = $ARCH{ $obj->{_name} };
317 my $type = $obj->{type} || $arch->{type};
315 318
316 if ($arch->{type} > 0) { 319 if ($type > 0) {
317 $root = $Crossfire::Data::ATTR{$arch->{type}+0}; 320 $root = $Crossfire::Data::ATTR{$type};
318 } else { 321 } else {
319 $root = $Crossfire::Data::TYPE{Misc}; 322 $root = $Crossfire::Data::TYPE{Misc};
320 323
321 type: 324 type:
322 for (@Crossfire::Data::ATTR0) { 325 for (@Crossfire::Data::ATTR0) {
324 or die "internal error: ATTR0 without 'required'"; 327 or die "internal error: ATTR0 without 'required'";
325 328
326 keys %$req; 329 keys %$req;
327 while (my ($k, $v) = each %$req) { 330 while (my ($k, $v) = each %$req) {
328 next type 331 next type
329 unless $arch->{$k} == $v; 332 unless $obj->{$k} eq $v || $arch->{$k} eq $v;
330 } 333 }
331 334
332 $root = $_; 335 $root = $_;
333 } 336 }
334 } 337 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines