Skip to content

Commit

Permalink
Update game.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
myallith authored and elsongabriel committed Feb 22, 2024
1 parent 8643a05 commit 6bcfac4
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/game/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1619,7 +1619,7 @@ void Game::playerMoveItem(std::shared_ptr<Player> player, const Position &fromPo
auto toHouseTile = map.getTile(mapToPos)->dynamic_self_cast<HouseTile>();
auto fromHouseTile = map.getTile(mapFromPos)->dynamic_self_cast<HouseTile>();
if (fromHouseTile && (!toHouseTile || toHouseTile->getHouse()->getId() != fromHouseTile->getHouse()->getId())) {
player->sendCancelMessage("You can't move this item outside a house.");
player->sendCancelMessage("You cannot move this item out of this house.");
return;
}
}
Expand Down Expand Up @@ -1666,12 +1666,12 @@ ReturnValue Game::checkMoveItemToCylinder(std::shared_ptr<Player> player, std::s
bool allowAnything = g_configManager().getBoolean(TOGGLE_GOLD_POUCH_ALLOW_ANYTHING, __FUNCTION__);

if (!allowAnything && item->getID() != ITEM_GOLD_COIN && item->getID() != ITEM_PLATINUM_COIN && item->getID() != ITEM_CRYSTAL_COIN) {
return RETURNVALUE_CONTAINERNOTENOUGHROOM;
return RETURNVALUE_ITEMCANNOTBEMOVEDPOUCH;
}

// prevent move up
// prevent move up from ponch to store inbox.
if (!item->canBeMovedToStore() && fromCylinder->getContainer() && fromCylinder->getContainer()->getID() == ITEM_GOLD_POUCH) {
return RETURNVALUE_CONTAINERNOTENOUGHROOM;
return RETURNVALUE_NOTBOUGHTINSTORE;
}

return RETURNVALUE_NOERROR;
Expand All @@ -1681,7 +1681,7 @@ ReturnValue Game::checkMoveItemToCylinder(std::shared_ptr<Player> player, std::s
const auto parentContainer = topParentContainer->getParent() ? topParentContainer->getParent()->getContainer() : nullptr;
auto isStoreInbox = parentContainer && parentContainer->isStoreInbox();
if (!item->canBeMovedToStore() && (containerID == ITEM_STORE_INBOX || isStoreInbox)) {
return RETURNVALUE_CONTAINERNOTENOUGHROOM;
return RETURNVALUE_NOTBOUGHTINSTORE;
}

if (item->isStoreItem()) {
Expand All @@ -1705,7 +1705,7 @@ ReturnValue Game::checkMoveItemToCylinder(std::shared_ptr<Player> player, std::s
}

if (!isValidMoveItem) {
return RETURNVALUE_NOTPOSSIBLE;
return RETURNVALUE_ITEMCANNOTBEMOVEDTHERE;
}

if (item->hasOwner() && !item->isOwner(player)) {
Expand Down Expand Up @@ -1738,7 +1738,7 @@ ReturnValue Game::checkMoveItemToCylinder(std::shared_ptr<Player> player, std::s
}

if (item->isStoreItem() && !house) {
return RETURNVALUE_NOTPOSSIBLE;
return RETURNVALUE_ITEMCANNOTBEMOVEDTHERE;
}
}
}
Expand Down

0 comments on commit 6bcfac4

Please sign in to comment.