File tree 1 file changed +13
-7
lines changed
1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -630,13 +630,19 @@ void Server::handleCommand_InventoryAction(NetworkPacket* pkt)
630630 if (ma->from_inv != ma->to_inv )
631631 m_inventory_mgr->setInventoryModified (ma->to_inv );
632632
633- bool from_inv_is_current_player =
634- (ma->from_inv .type == InventoryLocation::PLAYER) &&
635- (ma->from_inv .name == player->getName ());
636-
637- bool to_inv_is_current_player =
638- (ma->to_inv .type == InventoryLocation::PLAYER) &&
639- (ma->to_inv .name == player->getName ());
633+ bool from_inv_is_current_player = false ;
634+ if (ma->from_inv .type == InventoryLocation::PLAYER) {
635+ if (ma->from_inv .name != player->getName ())
636+ return ;
637+ from_inv_is_current_player = true ;
638+ }
639+
640+ bool to_inv_is_current_player = false ;
641+ if (ma->to_inv .type == InventoryLocation::PLAYER) {
642+ if (ma->to_inv .name != player->getName ())
643+ return ;
644+ to_inv_is_current_player = true ;
645+ }
640646
641647 InventoryLocation *remote = from_inv_is_current_player ?
642648 &ma->to_inv : &ma->from_inv ;
You can’t perform that action at this time.
0 commit comments