fix(Core/Spells): guard m_caster access during Spell destruction chain (#26782)
This commit is contained in:
@@ -4475,7 +4475,9 @@ void Spell::finish(bool ok)
|
|||||||
return;
|
return;
|
||||||
m_spellState = SPELL_STATE_FINISHED;
|
m_spellState = SPELL_STATE_FINISHED;
|
||||||
|
|
||||||
if (Player* modOwner = m_caster->GetSpellModOwner())
|
// FindMap() check: pending spell events are destroyed after the caster has left the map,
|
||||||
|
// where resolving a unit-summoned caster's owner through ObjectAccessor would assert
|
||||||
|
if (Player* modOwner = (m_caster && m_caster->FindMap()) ? m_caster->GetSpellModOwner() : nullptr)
|
||||||
modOwner->SetSpellModTakingSpell(this, false);
|
modOwner->SetSpellModTakingSpell(this, false);
|
||||||
|
|
||||||
if (m_spellInfo->IsChanneled())
|
if (m_spellInfo->IsChanneled())
|
||||||
|
|||||||
Reference in New Issue
Block a user