fix(Core/Spells): crashfix (#22986)

This commit is contained in:
Andrew
2025-09-20 12:21:42 -03:00
committed by GitHub
parent f9fd86af50
commit f884f64896

View File

@@ -4114,9 +4114,10 @@ void Spell::_cast(bool skipCheck)
SetExecutedCurrently(false);
// Call CreatureAI hook OnSpellCastFinished
if (Creature* caster = m_originalCaster->ToCreature())
if (caster->IsAIEnabled)
caster->AI()->OnSpellCastFinished(GetSpellInfo(), SPELL_FINISHED_SUCCESSFUL_CAST);
if (m_originalCaster)
if (Creature* caster = m_originalCaster->ToCreature())
if (caster->IsAIEnabled)
caster->AI()->OnSpellCastFinished(GetSpellInfo(), SPELL_FINISHED_SUCCESSFUL_CAST);
}
void Spell::handle_immediate()