aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Player/Player.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index f79a2eacd26..0ef3551e0d6 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -7770,7 +7770,7 @@ void Player::_ApplyItemBonuses(Item* item, uint8 slot, bool apply)
SetUpdateFieldValue(m_values.ModifyValue(&Player::m_activePlayerData).ModifyValue(&UF::ActivePlayerData::ShieldBlock), apply ? int32(armor * 2.5f) : 0);
}
- WeaponAttackType attType = GetAttackBySlot(slot, proto->GetInventoryType());
+ WeaponAttackType attType = Player::GetAttackBySlot(slot, proto->GetInventoryType());
if (attType != MAX_ATTACK && CanUseAttackType(attType))
_ApplyWeaponDamage(slot, item, apply);
}
@@ -7778,14 +7778,11 @@ void Player::_ApplyItemBonuses(Item* item, uint8 slot, bool apply)
void Player::_ApplyWeaponDamage(uint8 slot, Item* item, bool apply)
{
ItemTemplate const* proto = item->GetTemplate();
- WeaponAttackType attType = BASE_ATTACK;
- float damage = 0.0f;
-
- if (slot == EQUIPMENT_SLOT_MAINHAND && (proto->GetInventoryType() == INVTYPE_RANGED || proto->GetInventoryType() == INVTYPE_RANGEDRIGHT))
- attType = RANGED_ATTACK;
- else if (slot == EQUIPMENT_SLOT_OFFHAND)
- attType = OFF_ATTACK;
+ WeaponAttackType attType = Player::GetAttackBySlot(slot, proto->GetInventoryType());
+ if (attType == MAX_ATTACK)
+ return;
+ float damage = 0.0f;
uint32 itemLevel = item->GetItemLevel(this);
float minDamage, maxDamage;
proto->GetDamage(itemLevel, minDamage, maxDamage);