fix(Core/Spell): check for player before dereferencing (#19666)
This commit is contained in:
@@ -3739,8 +3739,9 @@ void Spell::cancel(bool bySelf)
|
|||||||
if (Unit* unit = m_caster->GetGUID() == ihit->targetGUID ? m_caster : ObjectAccessor::GetUnit(*m_caster, ihit->targetGUID))
|
if (Unit* unit = m_caster->GetGUID() == ihit->targetGUID ? m_caster : ObjectAccessor::GetUnit(*m_caster, ihit->targetGUID))
|
||||||
unit->RemoveOwnedAura(m_spellInfo->Id, m_originalCasterGUID, 0, AURA_REMOVE_BY_CANCEL);
|
unit->RemoveOwnedAura(m_spellInfo->Id, m_originalCasterGUID, 0, AURA_REMOVE_BY_CANCEL);
|
||||||
|
|
||||||
if (m_spellInfo->HasAttribute(SPELL_ATTR0_COOLDOWN_ON_EVENT))
|
if (m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||||
m_caster->ToPlayer()->RemoveSpellCooldown(m_spellInfo->Id, true);
|
if (m_spellInfo->HasAttribute(SPELL_ATTR0_COOLDOWN_ON_EVENT))
|
||||||
|
m_caster->ToPlayer()->RemoveSpellCooldown(m_spellInfo->Id, true);
|
||||||
|
|
||||||
SendChannelUpdate(0);
|
SendChannelUpdate(0);
|
||||||
SendInterrupted(SPELL_FAILED_INTERRUPTED);
|
SendInterrupted(SPELL_FAILED_INTERRUPTED);
|
||||||
|
|||||||
Reference in New Issue
Block a user