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.137 by root, Tue Dec 15 01:44:06 2009 UTC vs.
Revision 1.139 by root, Tue Dec 22 09:52:36 2009 UTC

6 6
7=cut 7=cut
8 8
9package Deliantra; 9package Deliantra;
10 10
11our $VERSION = '1.25'; 11our $VERSION = '1.29';
12 12
13use common::sense; 13use common::sense;
14 14
15use base 'Exporter'; 15use base 'Exporter';
16 16
815 $root = $Deliantra::Data::TYPE{Misc}; 815 $root = $Deliantra::Data::TYPE{Misc};
816 } 816 }
817 } 817 }
818 818
819 my @import = ($root); 819 my @import = ($root);
820 820
821 unshift @import, \%Deliantra::Data::DEFAULT_ATTR 821 unshift @import, \%Deliantra::Data::DEFAULT_ATTR
822 unless $type == 116; 822 unless $type == 116;
823 823
824 my (%ignore); 824 my (%ignore);
825 my (@section_order, %section, @attr_order); 825 my (@section_order, %section, @attr_order);
846 $section{$name}{$k} ||= $v; 846 $section{$name}{$k} ||= $v;
847 } 847 }
848 } 848 }
849 } 849 }
850 850
851 # remove ignores for "root" type
852 for (map @{$_->[1]}, # section attributes
853 [general => ($root->{attr} || [])],
854 @{$root->{section} || []})
855 {
856 my ($k, $v) = @$_;
857 # skip fixed attributes, if they are ignored thats fine
858 next if $v->{type} eq 'fixed';
859
860 delete $ignore{$k}; # if the attributes are defined explicitly they
861 # should NOT be ignored. ignore should mainly
862 # hit imported/inherited attributes.
863 }
864
851 $attr->{section} = [ 865 $attr->{section} = [
852 map !exists $section{$_} ? () : do { 866 map !exists $section{$_} ? () : do {
853 my $attr = delete $section{$_}; 867 my $attr = delete $section{$_};
854 868
855 [ 869 [
857 map exists $attr->{$_} && !$ignore{$_} 871 map exists $attr->{$_} && !$ignore{$_}
858 ? [$_ => delete $attr->{$_}] : (), 872 ? [$_ => delete $attr->{$_}] : (),
859 @attr_order 873 @attr_order
860 ] 874 ]
861 }, 875 },
862
863 exists $section{$_} ? [$_ => delete $section{$_}] : (), 876 exists $section{$_} ? [$_ => delete $section{$_}] : (),
864 @section_order 877 @section_order
865 ]; 878 ];
866 879
867 $attr 880 $attr

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines