mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-07 15:28:02 +00:00
fix(Core/Spells): clear stale spellmod tracking spell (#26535)
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user