From f884f6489611b99d9747db3507040c9cad5696c0 Mon Sep 17 00:00:00 2001 From: Andrew <47818697+Nyeriah@users.noreply.github.com> Date: Sat, 20 Sep 2025 12:21:42 -0300 Subject: [PATCH] fix(Core/Spells): crashfix (#22986) --- src/server/game/Spells/Spell.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 425189d1b..daddbe9dd 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -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()