From 2d0fb356de5b2dda06b008a875c6d4ea31eb5dfd Mon Sep 17 00:00:00 2001 From: ariel- Date: Mon, 17 Oct 2016 04:33:36 -0300 Subject: Core/Spell: clear auras of channeled spells if channeling is cancelled due to invalid targets (dead or w/e) Closes #14859 Closes #15186 --- src/server/game/Spells/Spell.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') 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) -- cgit v1.2.3