diff options
| author | ariel- <ariel-@users.noreply.github.com> | 2016-10-17 04:33:36 -0300 |
|---|---|---|
| committer | ariel- <ariel-@users.noreply.github.com> | 2016-10-17 04:33:36 -0300 |
| commit | 2d0fb356de5b2dda06b008a875c6d4ea31eb5dfd (patch) | |
| tree | a51464cdef933a4e18c7258431082a9b1b2c0493 | |
| parent | 2b9f807fd94db40568baa3d780ba7c218cccdd69 (diff) | |
Core/Spell: clear auras of channeled spells if channeling is cancelled due to invalid targets (dead or w/e)
Closes #14859
Closes #15186
| -rw-r--r-- | src/server/game/Spells/Spell.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 3e7783cfc62..a83a5a122ad 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -3583,8 +3583,12 @@ void Spell::update(uint32 difftime) if (!UpdateChanneledTargetList()) { TC_LOG_DEBUG("spells", "Channeled spell %d is removed due to lack of targets", m_spellInfo->Id); - SendChannelUpdate(0); - finish(); + m_timer = 0; + + // Also remove applied auras + for (TargetInfo const& target : m_UniqueTargetInfo) + if (Unit* unit = m_caster->GetGUID() == target.targetGUID ? m_caster : ObjectAccessor::GetUnit(*m_caster, target.targetGUID)) + unit->RemoveOwnedAura(m_spellInfo->Id, m_originalCasterGUID, 0, AURA_REMOVE_BY_CANCEL); } if (m_timer > 0) |
