mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-04 13:57:52 +00:00
fix(Core/Spells): don't resolve spellmod owner for casters no longer on a map (#26780)
This commit is contained in:
@@ -695,7 +695,9 @@ Spell::Spell(Unit* caster, SpellInfo const* info, TriggerCastFlags triggerFlags,
|
||||
|
||||
Spell::~Spell()
|
||||
{
|
||||
if (Player* modOwner = m_caster ? m_caster->GetSpellModOwner() : nullptr)
|
||||
// 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)
|
||||
if (modOwner->m_spellModTakingSpell == this)
|
||||
modOwner->SetSpellModTakingSpell(this, false);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user