Skip to content

Commit

Permalink
Merge branch 'main' into patch-gha-warning
Browse files Browse the repository at this point in the history
  • Loading branch information
elsongabriel authored Apr 22, 2024
2 parents 07bf73f + b73df39 commit 2cf2ae0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/creatures/players/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3271,13 +3271,6 @@ ReturnValue Player::queryAdd(int32_t index, const std::shared_ptr<Thing> &thing,
case CONST_SLOT_LEFT: {
if (item->isQuiver()) {
ret = RETURNVALUE_CANNOTBEDRESSED;
} else if (slotPosition & SLOTP_LEFT) {
WeaponType_t type = item->getWeaponType();
if (type == WEAPON_NONE || type == WEAPON_SHIELD || type == WEAPON_AMMO) {
ret = RETURNVALUE_CANNOTBEDRESSED;
} else {
ret = RETURNVALUE_NOERROR;
}
} else if (slotPosition & SLOTP_TWO_HAND) {
if (inventory[CONST_SLOT_RIGHT]) {
WeaponType_t type = item->getWeaponType();
Expand All @@ -3290,6 +3283,13 @@ ReturnValue Player::queryAdd(int32_t index, const std::shared_ptr<Thing> &thing,
} else {
ret = RETURNVALUE_NOERROR;
}
} else if (slotPosition & SLOTP_LEFT) {
WeaponType_t type = item->getWeaponType();
if (type == WEAPON_NONE || type == WEAPON_SHIELD || type == WEAPON_AMMO) {
ret = RETURNVALUE_CANNOTBEDRESSED;
} else {
ret = RETURNVALUE_NOERROR;
}
} else if (inventory[CONST_SLOT_RIGHT]) {
std::shared_ptr<Item> rightItem = inventory[CONST_SLOT_RIGHT];
WeaponType_t type = item->getWeaponType(), rightType = rightItem->getWeaponType();
Expand Down
5 changes: 5 additions & 0 deletions src/game/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5382,6 +5382,11 @@ void Game::playerSetManagedContainer(uint32_t playerId, ObjectCategory_t categor
return;
}

if (container->getID() == ITEM_GOLD_POUCH && !isLootContainer) {
player->sendTextMessage(MESSAGE_FAILURE, "You can only set the gold pouch as a loot container.");
return;
}

if (container->getHoldingPlayer() != player) {
player->sendCancelMessage("You must be holding the container to set it as a loot container.");
return;
Expand Down

0 comments on commit 2cf2ae0

Please sign in to comment.