--- deliantra/Deliantra-Client/DC/Protocol.pm 2006/06/28 21:43:15 1.47 +++ deliantra/Deliantra-Client/DC/Protocol.pm 2006/07/02 16:25:19 1.50 @@ -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; @@ -623,11 +618,6 @@ #d# print "item_update: $item->{tag} in $item->{container} ($self->{player}{tag}) ($::CONN->{open_container})\n"; - if ($item->{tag} == $self->{player}{tag}) { - $::STATWIDS->{weight}->set_text (sprintf "Weight: %.1fkg", $item->{weight} / 1000); - return; - } - CFClient::Item::update_widgets $item; if ($item->{tag} == $::CONN->{open_container} && not ($item->{flags} & F_OPEN)) { @@ -650,7 +640,6 @@ sub player_update { my ($self, $player) = @_; - $::STATWIDS->{weight}->set_text (sprintf "Weight: %.1fkg", $player->{weight} / 1000); }