From 0d70e16b0bf13fc80fc8e43c309f47a51c837c5c Mon Sep 17 00:00:00 2001 From: Zachary McAlpin Date: Thu, 11 Jun 2020 15:11:01 -0500 Subject: [PATCH] Updated LUAh_GameQuit to use new error handler --- src/lua_hooklib.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lua_hooklib.c b/src/lua_hooklib.c index 0d8aa1ffb..854f3ddfe 100644 --- a/src/lua_hooklib.c +++ b/src/lua_hooklib.c @@ -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);