--- deliantra/server/lib/cf.pm 2006/08/27 17:59:26 1.49 +++ deliantra/server/lib/cf.pm 2006/08/28 07:07:42 1.50 @@ -74,7 +74,7 @@ # we bless all objects into (empty) derived classes to force a method lookup # within the Safe compartment. -for my $pkg (qw(cf::object cf::object::player cf::player cf::map cf::party cf::region cf::arch)) { +for my $pkg (qw(cf::object cf::object::player cf::player cf::map cf::party cf::region cf::arch cf::living)) { no strict 'refs'; @{"safe::$pkg\::wrap::ISA"} = @{"$pkg\::wrap::ISA"} = $pkg; } @@ -264,7 +264,7 @@ warn "object uses attachment '$name' that is not available, postponing.\n"; } - push @{$obj->{_attachment}}, $name; + $obj->{_attachment}{$name} = undef; $res->{attachment} = $name; $res @@ -370,9 +370,9 @@ @$registry = (); - delete $obj->{_attachment} unless @{ $obj->{_attachment} || [] }; + delete $obj->{_attachment} unless scalar keys %{ $obj->{_attachment} || {} }; - for my $name (@{ $obj->{_attachment} || [] }) { + for my $name (keys %{ $obj->{_attachment} || {} }) { if (my $attach = $attachment{$name}) { for (@$attach) { my ($klass, @attach) = @$_; @@ -418,7 +418,7 @@ %$dst = %$src; - $dst->{_attachment} = [@{ $src->{_attachment} }] + %{$dst->{_attachment}} = %{$src->{_attachment}} if exists $src->{_attachment}; }, ; @@ -689,6 +689,7 @@ or return; # too new $map->_set_obs ($data->{obs}); + $map->invoke (EVENT_MAP_UPGRADE); }; attach_to_maps prio => -10000, package => cf::mapsupport::;