Skip to content

Commit 9f46023

Browse files
committed
Prevent disarming target with no main hand weapon.
How was there no check for this until now?
1 parent 7ce75e8 commit 9f46023

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/game/Spells/Spell.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7153,6 +7153,22 @@ SpellCastResult Spell::CheckCast(bool strict)
71537153

71547154
break;
71557155
}
7156+
case SPELL_AURA_MOD_DISARM:
7157+
{
7158+
if (Creature* pTarget = ToCreature(m_targets.getUnitTarget()))
7159+
{
7160+
if (!pTarget->CanUseEquippedWeapon(BASE_ATTACK) ||
7161+
!pTarget->GetVirtualItemDisplayId(BASE_ATTACK) ||
7162+
pTarget->GetVirtualItemClass(BASE_ATTACK) != ITEM_CLASS_WEAPON)
7163+
return SPELL_FAILED_TARGET_NO_WEAPONS;
7164+
}
7165+
else if (Player* pTarget = ToPlayer(m_targets.getUnitTarget()))
7166+
{
7167+
if (!pTarget->GetWeaponForAttack(BASE_ATTACK, true, true))
7168+
return SPELL_FAILED_TARGET_NO_WEAPONS;
7169+
}
7170+
break;
7171+
}
71567172
case SPELL_AURA_MOD_SHAPESHIFT:
71577173
{
71587174
if (m_casterUnit && m_casterUnit->HasAura(23397)) // Ustaag <Nostalrius> : Nefarian Warrior Class Call

0 commit comments

Comments
 (0)