From bd7d69c495d6417eff1a0010fb19eb91742f3562 Mon Sep 17 00:00:00 2001 From: Emagi Date: Sun, 19 Jan 2025 10:23:57 -0500 Subject: [PATCH] Additionally RemoveProc should only remove the target, not all targets in the spell --- source/WorldServer/LuaFunctions.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/WorldServer/LuaFunctions.cpp b/source/WorldServer/LuaFunctions.cpp index fdcc78b..148ad20 100644 --- a/source/WorldServer/LuaFunctions.cpp +++ b/source/WorldServer/LuaFunctions.cpp @@ -8736,8 +8736,11 @@ int EQ2Emu_lua_RemoveProc(lua_State* state) { lua_interface->LogError("%s: LUA RemoveProc command error: can only use with an item provided or inside a spell script", lua_interface->GetScriptName(state)); return 0; } - - if (spell && spell->caster && spell->caster->GetZone()) { + + if(spawn && spawn->IsEntity()) { + ((Entity*)spawn)->RemoveProc(item, spell); + } + else if (spell && spell->caster && spell->caster->GetZone()) { Spawn* target; spell->MSpellTargets.readlock(__FUNCTION__, __LINE__); for (int8 i = 0; i < spell->targets.size(); i++) { @@ -8758,9 +8761,6 @@ int EQ2Emu_lua_RemoveProc(lua_State* state) { lua_interface->LogError("%s: LUA RemoveProc command error: spawn is not a valid entity", lua_interface->GetScriptName(state)); return 0; } - else { - ((Entity*)spawn)->RemoveProc(item, spell); - } return 0; }