From 617e8fdd551bb7ce2d96966b1dd57edf4b1b5ad1 Mon Sep 17 00:00:00 2001 From: MIDIMan Date: Wed, 29 Jul 2026 17:08:24 -0400 Subject: [PATCH 01/10] Manually set NetVars's hook_type Also adds a 2.3 TODO comment for MF_AMBIENT --- src/lua_hooklib.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lua_hooklib.c b/src/lua_hooklib.c index fe997123b..a488c7ed6 100644 --- a/src/lua_hooklib.c +++ b/src/lua_hooklib.c @@ -1062,6 +1062,9 @@ void LUA_HookNetArchive(lua_CFunction archFunc, savebuffer_t *save) lua_pushcclosure(gL, archFunc, 2); // stack: tables, savebuffer_t, archFunc + // Manually set the hook's variables here since we don't call prepare_hook + hook.hook_type = HOOK(NetVars); + hook.mobj_type = NONMOHOOK; // Force mobj_type to be NONMOHOOK so the mobj_type check get skipped init_hook_call(&hook, 0, res_none); call_mapped(&hook, map); From f03692b840fca24768a325b9fbc19399a6543efe Mon Sep 17 00:00:00 2001 From: Alug Date: Wed, 5 Aug 2026 22:46:49 +0200 Subject: [PATCH 02/10] delet duped MobjThinker check --- src/lua_hooklib.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/lua_hooklib.c b/src/lua_hooklib.c index a488c7ed6..82c1a00d6 100644 --- a/src/lua_hooklib.c +++ b/src/lua_hooklib.c @@ -584,7 +584,6 @@ FUNCINLINE static ATTRINLINE int call_mobj_type_hooks(Hook_State *hook, mobjtype || hook->hook_type == MOBJ_HOOK(MobjCollide ) || hook->hook_type == MOBJ_HOOK(MobjMoveCollide) || hook->hook_type == MOBJ_HOOK(MobjFuse ) - || hook->hook_type == MOBJ_HOOK(MobjThinker ) || hook->hook_type == MOBJ_HOOK(BossThinker ) )) { From c39073dd9e9e6195aca9b930a61e6002a07d5929 Mon Sep 17 00:00:00 2001 From: Alug Date: Thu, 6 Aug 2026 15:09:17 +0200 Subject: [PATCH 03/10] fix arm compile idk why i added this, if this is ever needed for whatever pls yell at me --- src/Makefile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/Makefile b/src/Makefile index 4ee7cf1a9..5b1f9f0fa 100644 --- a/src/Makefile +++ b/src/Makefile @@ -246,10 +246,6 @@ ifdef STATIC libs+=-static endif -ifneq (,$(filter $(CC) $(CXX),gcc g++)) - opts+=-mno-ms-bitfields -endif - # build with profiling information ifdef PROFILEMODE opts+=-pg From 2f9a400cf399fa4c51a48a17764a052328826f5a Mon Sep 17 00:00:00 2001 From: Alug Date: Thu, 6 Aug 2026 16:48:23 +0200 Subject: [PATCH 04/10] cmake flag for mumble stimky --- src/CMakeLists.txt | 3 +++ src/sdl/CMakeLists.txt | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 85ced4e54..28f48cdad 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -247,6 +247,9 @@ set(SRB2_CONFIG_ASAN OFF CACHE BOOL set(SRB2_CONFIG_UBSAN OFF CACHE BOOL "Compile with UndefinedBehaviorSanitizer (libubsan).") +set(SRB2_CONFIG_MUMBLE ON CACHE BOOL + "Enable Mumble support") + set(SRB2_CONFIG_SATURNPAK ON CACHE BOOL "Enable Saturn specific special packet. Required for using the newer resynch system") set(SRB2_CONFIG_SATURNJOIN ON CACHE BOOL diff --git a/src/sdl/CMakeLists.txt b/src/sdl/CMakeLists.txt index c7d612c80..13b41323e 100644 --- a/src/sdl/CMakeLists.txt +++ b/src/sdl/CMakeLists.txt @@ -243,6 +243,10 @@ if(${SDL2_FOUND}) target_link_options(SRB2SDL2 PRIVATE -fsanitize=undefined) endif() + if(NOT SRB2_CONFIG_MUMBLE) + target_compile_options(SRB2SDL2 PRIVATE -DNOMUMBLE) + endif() + ## strip debug symbols into separate file when using gcc # if(CMAKE_COMPILER_IS_GNUCC) # if(${CMAKE_BUILD_TYPE} MATCHES Debug) From 91604315566d08cdf97da161eecc109802ff6719 Mon Sep 17 00:00:00 2001 From: Alug Date: Thu, 6 Aug 2026 16:57:32 +0200 Subject: [PATCH 05/10] fix compile for android bionic c lib --- src/sdl/i_system.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/sdl/i_system.cpp b/src/sdl/i_system.cpp index dd3508efd..48ba6a21e 100644 --- a/src/sdl/i_system.cpp +++ b/src/sdl/i_system.cpp @@ -1405,7 +1405,11 @@ void I_SleepDuration(precise_t duration) duration -= slack; struct timespec ts = { .tv_sec = static_cast<__time_t>(duration / precision), +#ifdef __BIONIC__ + .tv_nsec = static_cast(duration * 1000000000 / precision % 1000000000), +#else .tv_nsec = static_cast<__syscall_slong_t>(duration * 1000000000 / precision % 1000000000), +#endif }; int status; do status = clock_nanosleep(CLOCK_MONOTONIC, 0, &ts, &ts); From b2cdbaae60407e5ed865b19333ce1c1732806416 Mon Sep 17 00:00:00 2001 From: Alug Date: Thu, 6 Aug 2026 16:57:42 +0200 Subject: [PATCH 06/10] fix protocol register thingie --- src/d_protocol.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/d_protocol.c b/src/d_protocol.c index 963d8e587..7cf84be93 100644 --- a/src/d_protocol.c +++ b/src/d_protocol.c @@ -211,12 +211,12 @@ void D_SetupProtocol(void) if (result) { - if (!fastcmp(buffer, "no")) + if (fastcmp(buffer, "no")) { fclose(fp); return; } - else if (fastcmp(buffer, exe_path)) + else if (!fastcmp(buffer, exe_path)) { // overwrite fclose(fp); From 88d86a6e600c185eca9d6aab56f145688ae0c692 Mon Sep 17 00:00:00 2001 From: Alug Date: Thu, 6 Aug 2026 17:04:55 +0200 Subject: [PATCH 07/10] fix NOMUMBLE compile idk how and why this breaks, but I_OutputMsg is in doomdef anyways for god knows why --- src/m_curl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/m_curl.c b/src/m_curl.c index 77588a3fb..f7ff29955 100644 --- a/src/m_curl.c +++ b/src/m_curl.c @@ -11,7 +11,7 @@ #include "m_curl.h" #include "doomtype.h" -#include "i_system.h" // I_OutputMsg +#include "doomdef.h" // I_OutputMsg #include "m_argv.h" // M_CheckParm, M_GetNextParm static boolean curl_args_init = false; From 5d807d65e530458634f4a452366eefa06fe568a5 Mon Sep 17 00:00:00 2001 From: Alug Date: Thu, 6 Aug 2026 17:43:07 +0200 Subject: [PATCH 08/10] smol style fix less confusing --- src/d_netfil.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/d_netfil.c b/src/d_netfil.c index 944d9560b..613b72df5 100644 --- a/src/d_netfil.c +++ b/src/d_netfil.c @@ -1616,8 +1616,7 @@ static void CURLGetFile(void) #endif } -HTTP_login * -CURLGetLogin (const char *url, HTTP_login ***return_prev_next) +HTTP_login *CURLGetLogin(const char *url, HTTP_login ***return_prev_next) { HTTP_login * login; HTTP_login ** prev_next; @@ -1627,7 +1626,7 @@ CURLGetLogin (const char *url, HTTP_login ***return_prev_next) ( login = (*prev_next)); prev_next = &login->next ){ - if (fastcmp(login->url, url) != 0) + if (fastcmp(login->url, url)) { if (return_prev_next) (*return_prev_next) = prev_next; From 73bc64f9dad3b5befa9596c5fb1b7b17745c33db Mon Sep 17 00:00:00 2001 From: Alug Date: Thu, 6 Aug 2026 22:16:15 +0200 Subject: [PATCH 09/10] fix clamp assert in HWR_SplitWall idk man it really hates if lo > hi apparently lol --- src/hardware/hw_main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hardware/hw_main.cpp b/src/hardware/hw_main.cpp index 562be50bb..907f80cf0 100644 --- a/src/hardware/hw_main.cpp +++ b/src/hardware/hw_main.cpp @@ -1101,8 +1101,8 @@ static void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum, // Found a break // The heights are clamped to ensure the polygon doesn't cross itself. - bot = std::clamp(bheight, realbot, top); - endbot = std::clamp(endbheight, endrealbot, endtop); + bot = std::min(std::max(bheight, realbot), top); + endbot = std::min(std::max(endbheight, endrealbot), endtop); Surf->PolyColor.s.alpha = alpha; From 421d735052d059c6fd096bd63fc88adcff27f603 Mon Sep 17 00:00:00 2001 From: Alug Date: Thu, 6 Aug 2026 22:15:29 +0200 Subject: [PATCH 10/10] fix compiler complains when compiling with valgrind support --- src/Makefile.d/features.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile.d/features.mk b/src/Makefile.d/features.mk index 410077939..af67a5494 100644 --- a/src/Makefile.d/features.mk +++ b/src/Makefile.d/features.mk @@ -86,7 +86,7 @@ ifdef VALGRIND VALGRIND_PKGCONFIG?=valgrind VALGRIND_LDFLAGS= $(eval $(call Use_pkg_config,VALGRIND)) -ZDEBUG=1 +#ZDEBUG=1 we enable this by default opts+=-DHAVE_VALGRIND endif