mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 23:50:44 +01:00
Core/Spell: clear auras of channeled spells if channeling is cancelled due to invalid targets (dead or w/e)
Closes #14859 Closes #15186
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user