From b876e585b1724b039d9523429bf21c69a8c97412 Mon Sep 17 00:00:00 2001 From: yamamama Date: Sun, 19 Apr 2026 07:51:32 -0400 Subject: [PATCH 1/3] Don't optimize out getstack, please! --- src/blua/ldebug.c | 2 +- src/blua/lua.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/blua/ldebug.c b/src/blua/ldebug.c index 143d5d614..1eef598d1 100644 --- a/src/blua/ldebug.c +++ b/src/blua/ldebug.c @@ -84,7 +84,7 @@ LUA_API int lua_gethookcount (lua_State *L) { } -LUA_API int lua_getstack (lua_State *L, int level, lua_Debug *ar) { +__attribute__((used)) LUA_API int lua_getstack (lua_State *L, int level, lua_Debug *ar) { int status; CallInfo *ci; lua_lock(L); diff --git a/src/blua/lua.h b/src/blua/lua.h index 4e26c2a79..88787c914 100644 --- a/src/blua/lua.h +++ b/src/blua/lua.h @@ -331,7 +331,7 @@ typedef struct lua_Debug lua_Debug; /* activation record */ typedef void (*lua_Hook) (lua_State *L, lua_Debug *ar); -LUA_API int lua_getstack (lua_State *L, int level, lua_Debug *ar); +__attribute__((used)) LUA_API int lua_getstack (lua_State *L, int level, lua_Debug *ar); LUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar); LUA_API const char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n); LUA_API const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n); From b6804b1ded114d1e3aa92994750df85d729547b3 Mon Sep 17 00:00:00 2001 From: yamamama Date: Sun, 19 Apr 2026 07:51:57 -0400 Subject: [PATCH 2/3] Try to make sure consoleplayer is set up before game ticks run --- src/d_clisrv.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 33802170e..041dff59d 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -6972,6 +6972,12 @@ boolean TryRunTics(tic_t realtics) dontRun = false; } + if ((gamestate == GS_LEVEL) && (!(addedtogame || dedicated))) + { + // Prevent race conditions by not running game ticks if we're not added to the game yet + dontRun = true; + } + if (dontRun == false) { if (levelloading == true) From 600d1363b2572adcf5df95dfd723b3ddcfc395ac Mon Sep 17 00:00:00 2001 From: NepDisk Date: Sun, 19 Apr 2026 12:22:27 -0400 Subject: [PATCH 3/3] Revert "Try to make sure consoleplayer is set up before game ticks run" This reverts commit b6804b1ded114d1e3aa92994750df85d729547b3. --- src/d_clisrv.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 041dff59d..33802170e 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -6972,12 +6972,6 @@ boolean TryRunTics(tic_t realtics) dontRun = false; } - if ((gamestate == GS_LEVEL) && (!(addedtogame || dedicated))) - { - // Prevent race conditions by not running game ticks if we're not added to the game yet - dontRun = true; - } - if (dontRun == false) { if (levelloading == true)