fix(Core/Spells): clear stale spellmod tracking spell (#26535)

This commit is contained in:
Yehonal
2026-07-24 05:51:54 +00:00
committed by GitHub
parent af7bc95fad
commit d1331412e6

View File

@@ -695,6 +695,10 @@ Spell::Spell(Unit* caster, SpellInfo const* info, TriggerCastFlags triggerFlags,
Spell::~Spell()
{
if (Player* modOwner = m_caster ? m_caster->GetSpellModOwner() : nullptr)
if (modOwner->m_spellModTakingSpell == this)
modOwner->SetSpellModTakingSpell(this, false);
// unload scripts
while (!m_loadedScripts.empty())
{
@@ -4469,6 +4473,9 @@ void Spell::finish(bool ok)
return;
m_spellState = SPELL_STATE_FINISHED;
if (Player* modOwner = m_caster->GetSpellModOwner())
modOwner->SetSpellModTakingSpell(this, false);
if (m_spellInfo->IsChanneled())
m_caster->UpdateInterruptMask();