refactor(Core): use the WeaponAttackType enum (#23457)

This commit is contained in:
Tereneckla
2025-11-01 18:26:18 +00:00
committed by GitHub
parent 97543ba50f
commit e35a5ae049
7 changed files with 24 additions and 22 deletions

View File

@@ -3002,12 +3002,12 @@ void AuraEffect::HandleAuraModDisarm(AuraApplication const* aurApp, uint8 mode,
{
if (Item* pItem = target->ToPlayer()->GetItemByPos(INVENTORY_SLOT_BAG_0, slot))
{
uint8 attacktype = Player::GetAttackBySlot(slot);
WeaponAttackType attacktype = Player::GetAttackBySlot(slot);
if (attacktype < MAX_ATTACK)
{
target->ToPlayer()->_ApplyWeaponDamage(slot, pItem->GetTemplate(), nullptr, !apply);
target->ToPlayer()->_ApplyWeaponDependentAuraMods(pItem, WeaponAttackType(attacktype), !apply);
target->ToPlayer()->_ApplyWeaponDependentAuraMods(pItem, attacktype, !apply);
}
}
}

View File

@@ -1824,7 +1824,7 @@ SpellCastResult SpellInfo::CheckTarget(Unit const* caster, WorldObject const* ta
{
if (Player const* player = unitTarget->ToPlayer())
{
if (player->GetWeaponForAttack(WeaponAttackType(BASE_ATTACK + i), true))
if (player->GetWeaponForAttack(WeaponAttackType(i), true))
{
valid = true;
break;