1
0

Fix proc to pop from the stack if isfunction call fails.

This commit is contained in:
Emagi 2024-09-25 06:52:43 -04:00
parent c20f97faa5
commit 48ee02ea90
2 changed files with 5 additions and 3 deletions

View File

@ -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__);

View File

@ -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__);