diff --git a/source/WorldServer/Combat.cpp b/source/WorldServer/Combat.cpp index dc8210c..4ea3f18 100644 --- a/source/WorldServer/Combat.cpp +++ b/source/WorldServer/Combat.cpp @@ -1790,7 +1790,9 @@ bool Entity::CastProc(Proc* proc, int8 type, Spawn* target) { return false; } } - + else if(state) { + lua_pop(state, 1); + } lua_interface->ResetFunctionStack(state); if(mutex) mutex->releasereadlock(__FUNCTION__); diff --git a/source/WorldServer/LuaInterface.cpp b/source/WorldServer/LuaInterface.cpp index 5fd41cc..69ab42f 100644 --- a/source/WorldServer/LuaInterface.cpp +++ b/source/WorldServer/LuaInterface.cpp @@ -854,9 +854,9 @@ void LuaInterface::RemoveSpell(LuaSpell* spell, bool call_remove_function, bool lua_pushstring(spell->state, (char*)reason.c_str()); - lua_pcall(spell->state, 3, 0, 0); - ResetFunctionStack(spell->state); + lua_pcall(spell->state, 3, 0, 0); } + ResetFunctionStack(spell->state); } spell->MSpellTargets.readlock(__FUNCTION__, __LINE__);