aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorariel- <ariel-@users.noreply.github.com>2016-10-17 04:33:36 -0300
committerjoschiwald <joschiwald.trinity@gmail.com>2017-10-03 21:14:28 +0200
commit93973b87b16feb145abd3898815fbe457b684d5e (patch)
treec683a179a7a0074628c1fc7da9eaf44818fee78e /src
parentcaf47b846f9a7ef667f86757c06b162081b44ae6 (diff)
Core/Spell: clear auras of channeled spells if channeling is cancelled due to invalid targets (dead or w/e)
Closes #14859 Closes #15186 (cherry picked from commit 2d0fb356de5b2dda06b008a875c6d4ea31eb5dfd)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Spells/Spell.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 0e5bfa0d653..bc19e1cc51d 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -3669,8 +3669,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)