mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 07:48:02 +00:00
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;
|
||||
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);
|
||||
|
||||
if (m_spellInfo->IsChanneled())
|
||||
|
||||
Reference in New Issue
Block a user