diff --git a/src/creatures/npcs/npc.cpp b/src/creatures/npcs/npc.cpp index 7f912a3c185..6d38524aef3 100644 --- a/src/creatures/npcs/npc.cpp +++ b/src/creatures/npcs/npc.cpp @@ -235,8 +235,7 @@ void Npc::onPlayerBuyItem(std::shared_ptr player, uint16_t itemId, uint8 } // Check if the player not have empty slots or the item is not a container - auto mainBackpack = player->getInventoryItem(CONST_SLOT_BACKPACK); - if (!ignore && (player->getFreeBackpackSlots() == 0 && (mainBackpack || (!Item::items[itemId].isContainer() || !(Item::items[itemId].slotPosition & SLOTP_BACKPACK))))) { + if (!ignore && (player->getFreeBackpackSlots() == 0 && (player->getInventoryItem(CONST_SLOT_BACKPACK) || (!Item::items[itemId].isContainer() || !(Item::items[itemId].slotPosition & SLOTP_BACKPACK))))) { player->sendCancelMessage(RETURNVALUE_NOTENOUGHROOM); return; }