From 3f107dc175fc78d2fd5bdfaa615e8ba5ddd1eb0e Mon Sep 17 00:00:00 2001 From: aokisama <78324439+aokisama@users.noreply.github.com> Date: Mon, 21 Oct 2024 19:37:55 -0500 Subject: [PATCH] fix: container check changes so we can still sell all loot from pouch (#2971) Able to sell all loot in pouch --- src/creatures/players/player.cpp | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/creatures/players/player.cpp b/src/creatures/players/player.cpp index 27e113b852b..1cc22b8ce6c 100644 --- a/src/creatures/players/player.cpp +++ b/src/creatures/players/player.cpp @@ -4116,21 +4116,23 @@ std::map &Player::getAllItemTypeCount(std::map &Player::getAllSaleItemIdAndCount(std::map &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 &countMap) const {