Updated LUAh_GameQuit to use new error handler

This commit is contained in:
Zachary McAlpin 2020-06-11 15:11:01 -05:00
parent 08e9efee76
commit 0d70e16b0b

View file

@ -1778,13 +1778,15 @@ void LUAh_GameQuit(void)
if (!gL || !(hooksAvailable[hook_GameQuit/8] & (1<<(hook_GameQuit%8))))
return;
lua_pushcfunction(gL, LUA_GetErrorMessage);
for (hookp = roothook; hookp; hookp = hookp->next)
{
if (hookp->type != hook_GameQuit)
continue;
PushHook(gL, hookp);
if (lua_pcall(gL, 0, 0, 0)) {
if (lua_pcall(gL, 0, 0, 1)) {
if (!hookp->error || cv_debug & DBG_LUA)
CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
lua_pop(gL, 1);