Skip to content

Commit

Permalink
fix: container check changes so we can still sell all loot from pouch (
Browse files Browse the repository at this point in the history
…opentibiabr#2971)

Able to sell all loot in pouch
  • Loading branch information
aokisama authored Oct 22, 2024
1 parent c5b2804 commit 3f107dc
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions src/creatures/players/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4116,21 +4116,23 @@ std::map<uint32_t, uint32_t> &Player::getAllItemTypeCount(std::map<uint32_t, uin
}

std::map<uint16_t, uint16_t> &Player::getAllSaleItemIdAndCount(std::map<uint16_t, uint16_t> &countMap) const {
for (const auto &item : getAllInventoryItems(false, true)) {
if (!item->hasMarketAttributes()) {
continue;
}

if (const auto &container = item->getContainer()) {
if (container->size() > 0) {
continue;
}
}

countMap[item->getID()] += item->getItemCount();
}

return countMap;
for (const auto &item : getAllInventoryItems(false, true)) {
if (item->getID() != ITEM_GOLD_POUCH) {
if (!item->hasMarketAttributes()) {
continue;
}

if (const auto &container = item->getContainer()) {
if (!container->empty()) {
continue;
}
}
}

countMap[item->getID()] += item->getItemCount();
}

return countMap;
}

void Player::getAllItemTypeCountAndSubtype(std::map<uint32_t, uint32_t> &countMap) const {
Expand Down

0 comments on commit 3f107dc

Please sign in to comment.