1
0

avoid crash for disabled spell/no spell ptr

This commit is contained in:
Emagi 2025-01-29 22:01:51 -05:00
parent 4213beec95
commit d463ed3dc5

View File

@ -2800,8 +2800,8 @@ void SpellProcess::ClearSpellScriptTimerList() {
void SpellProcess::RemoveTargetFromSpell(LuaSpell* spell, Spawn* target, bool removeCaster){ void SpellProcess::RemoveTargetFromSpell(LuaSpell* spell, Spawn* target, bool removeCaster){
if (!spell || !target) if (!spell || !target)
return; return;
LogWrite(SPELL__DEBUG, 0, "Spell", "%s RemoveTargetFromSpell %s (%u).", spell->spell->GetName(), target->GetName(), target->GetID()); LogWrite(SPELL__DEBUG, 0, "Spell", "%s RemoveTargetFromSpell %s (%u).", spell->spell ? spell->spell->GetName() : "INACTIVE_SPELL", target->GetName(), target->GetID());
MRemoveTargetList.writelock(__FUNCTION__, __LINE__); MRemoveTargetList.writelock(__FUNCTION__, __LINE__);
if(removeCaster && spell->caster && spell->caster == target) if(removeCaster && spell->caster && spell->caster == target)