From 43e35385f741a3c48cf667fd55bc1175d1d2b927 Mon Sep 17 00:00:00 2001 From: dacctal Date: Tue, 14 Jul 2026 21:38:16 +0000 Subject: idk what i changed --- src/lua_globs.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/lua_globs.c') diff --git a/src/lua_globs.c b/src/lua_globs.c index ce5a59b..b14eb3a 100644 --- a/src/lua_globs.c +++ b/src/lua_globs.c @@ -138,11 +138,13 @@ bool lua_try_function(lua_State *L, char *lua_file, char *fname) { bldit_isnt_type(fname, "function"); else lua_isnt_type(fname, "function"); + lua_pop(L, 1); } else if (lua_pcall(L, 0, 1, 0) != LUA_OK) { log_warn( "%s: '%s' function borked: %s", lua_file, fname, lua_tostring(L, -1) ); + lua_pop(L, 1); return false; } if (!lua_isnumber(L, -1) || lua_tonumber(L, -1) != 0) { @@ -150,6 +152,7 @@ bool lua_try_function(lua_State *L, char *lua_file, char *fname) { "%s: '%s' failed: %s", lua_file, fname, lua_tostring(L, -1) ); + lua_pop(L, 1); return false; } lua_pop(L, 1); @@ -158,14 +161,13 @@ bool lua_try_function(lua_State *L, char *lua_file, char *fname) { bool lua_try_table(lua_State *L, char *lua_file, char *tname) { lua_getfield(L, -1, tname); - bool val = true; if (!lua_istable(L, -1)) { - val = false; - lua_pop(L, 1); if (!strcmp(lua_file, "bldit.lua")) bldit_isnt_type(tname, "table"); else lua_isnt_type(tname, "table"); + lua_pop(L, 1); + return false; } - return val; + return true; } -- cgit v1.2.3