Skip to content

Commit

Permalink
RemoveSpellAuraHolder: check for target congruence instead of spell t…
Browse files Browse the repository at this point in the history
…ype to interrupt channeling (vmangos#244) (vmangos#252)
  • Loading branch information
WobLight authored and Velite12 committed Oct 11, 2021
1 parent aa67744 commit 061c285
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/game/Objects/Unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4583,9 +4583,12 @@ void Unit::RemoveSpellAuraHolder(SpellAuraHolder *holder, AuraRemoveMode mode)
else
delete holder;

if (mode != AURA_REMOVE_BY_EXPIRE && IsChanneledSpell(AurSpellInfo) && !IsAreaOfEffectSpell(AurSpellInfo) && caster)
if (caster->GetCurrentSpell(CURRENT_CHANNELED_SPELL) && caster->GetCurrentSpell(CURRENT_CHANNELED_SPELL)->m_spellInfo->Id == auraSpellId)
if (mode != AURA_REMOVE_BY_EXPIRE && IsChanneledSpell(AurSpellInfo) && caster)
{
Spell *channeled = caster->GetCurrentSpell(CURRENT_CHANNELED_SPELL);
if (channeled && channeled->m_spellInfo->Id == auraSpellId && channeled->m_targets.getUnitTarget() == this)
caster->InterruptSpell(CURRENT_CHANNELED_SPELL);
}
}

void Unit::RemoveSingleAuraFromSpellAuraHolder(SpellAuraHolder *holder, SpellEffectIndex index, AuraRemoveMode mode)
Expand Down

0 comments on commit 061c285

Please sign in to comment.