Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
luanluciano93 committed Sep 11, 2024
1 parent 39d8952 commit 3226343
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/creatures/players/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6518,7 +6518,7 @@ void sendStowItems(const std::shared_ptr<Item> &item, const std::shared_ptr<Item
}

void Player::stowItem(std::shared_ptr<Item> item, uint32_t count, bool allItems) {
if (!item || !item->isItemStorable()) {
if (!item || (!item->isItemStorable() && item->getID() != ITEM_GOLD_POUCH)) {
sendCancelMessage("This item cannot be stowed here.");
return;
}
Expand Down
8 changes: 5 additions & 3 deletions src/game/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1845,7 +1845,9 @@ ReturnValue Game::checkMoveItemToCylinder(std::shared_ptr<Player> player, std::s
}
}

if (containerID == ITEM_GOLD_POUCH) {
const auto containerToStow = isTryingToStow(toPos, toCylinder);

if (containerID == ITEM_GOLD_POUCH && !containerToStow) {
if (g_configManager().getBoolean(TOGGLE_GOLD_POUCH_QUICKLOOT_ONLY, __FUNCTION__)) {
return RETURNVALUE_CONTAINERNOTENOUGHROOM;
}
Expand All @@ -1871,7 +1873,7 @@ ReturnValue Game::checkMoveItemToCylinder(std::shared_ptr<Player> player, std::s
return RETURNVALUE_NOTBOUGHTINSTORE;
}

if (item->isStoreItem()) {
if (item->isStoreItem() && !containerToStow) {
bool isValidMoveItem = false;
auto fromHouseTile = fromCylinder->getTile();
auto house = fromHouseTile ? fromHouseTile->getHouse() : nullptr;
Expand Down Expand Up @@ -1902,7 +1904,7 @@ ReturnValue Game::checkMoveItemToCylinder(std::shared_ptr<Player> player, std::s

if (item->getContainer() && !item->isStoreItem()) {
for (const std::shared_ptr<Item> &containerItem : item->getContainer()->getItems(true)) {
if (containerItem->isStoreItem() && !isTryingToStow(toPos, toCylinder) && ((containerID != ITEM_GOLD_POUCH && containerID != ITEM_DEPOT && containerID != ITEM_STORE_INBOX) || (topParentContainer->getParent() && topParentContainer->getParent()->getContainer() && (!topParentContainer->getParent()->getContainer()->isDepotChest() || topParentContainer->getParent()->getContainer()->getID() != ITEM_STORE_INBOX)))) {
if (containerItem->isStoreItem() && !containerToStow && ((containerID != ITEM_GOLD_POUCH && containerID != ITEM_DEPOT && containerID != ITEM_STORE_INBOX) || (topParentContainer->getParent() && topParentContainer->getParent()->getContainer() && (!topParentContainer->getParent()->getContainer()->isDepotChest() || topParentContainer->getParent()->getContainer()->getID() != ITEM_STORE_INBOX)))) {
return RETURNVALUE_NOTPOSSIBLE;
}
}
Expand Down

0 comments on commit 3226343

Please sign in to comment.