Skip to content

Commit

Permalink
fix: two handed weapons (opentibiabr#2570)
Browse files Browse the repository at this point in the history
  • Loading branch information
duuh30 authored Apr 22, 2024
1 parent 955fdde commit b73df39
Showing 1 changed file with 7 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

0 comments on commit b73df39

Please sign in to comment.