Fix crash on lovr.event.quit("restart")

This commit is contained in:
mcc 2020-04-15 17:59:25 -04:00
parent 936766bd22
commit 334077c9f8
1 changed files with 1 additions and 1 deletions

View File

@ -511,7 +511,7 @@ void bridgeLovrUpdate(BridgeLovrUpdateData *updateData) {
luax_clearerror(T);
lovrSetErrorCallback(luax_vthrow, T);
if (lua_resume(T, 1) != LUA_YIELD) {
if (lua_type(T, -1) == LUA_TSTRING && !strcmp(lua_tostring(T, -1), "restart")) {
if (lua_type(T, -2) == LUA_TSTRING && !strcmp(lua_tostring(T, -2), "restart")) {
state.renderCallback = NULL;
state.renderUserdata = NULL;
lua_close(L);