--- deliantra/Deliantra-Client/DC/Protocol.pm 2006/06/28 21:43:15 1.47 +++ deliantra/Deliantra-Client/DC/Protocol.pm 2006/06/28 23:39:15 1.49 @@ -571,20 +571,6 @@ $::INVR->set_items ($conn->{container}{$tag}); } -sub update_container { - my ($tag) = @_; - - $::INVR->set_items ($::CONN->{container}{$::CONN->{open_container}}) - if $tag == $::CONN->{open_container}; -} - -sub container_add { - my ($self, $tag, $items) = @_; - - $self->{update_container}{$tag}++; - $self->update_containers; -} - sub update_containers { my ($self) = @_; @@ -592,16 +578,25 @@ for my $tag (keys %{ delete $self->{update_container} }) { if ($tag == 0) { update_floorbox; - update_container (0); + $::INVR->set_items ($self->{container}{0}) + if $tag == $self->{open_container}; } elsif ($tag == $self->{player}{tag}) { $::INV->set_items ($self->{container}{$tag}) } else { - update_container ($tag); + $::INVR->set_items ($self->{container}{$tag}) + if $tag == $self->{open_container}; } } }); } +sub container_add { + my ($self, $tag, $items) = @_; + + $self->{update_container}{$tag}++; + $self->update_containers; +} + sub container_clear { my ($self, $tag) = @_; @@ -612,7 +607,7 @@ sub item_delete { my ($self, @items) = @_; - $self->{update_container}{$_->{tag}}++ + $self->{update_container}{$_->{container}}++ for @items; $self->update_containers;