Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
carlospess0a committed Sep 7, 2024
1 parent f88ff54 commit f675010
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/creatures/npcs/npc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,7 @@ void Npc::onPlayerBuyItem(std::shared_ptr<Player> 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;
}
Expand Down

0 comments on commit f675010

Please sign in to comment.