From ab0d071d35e53af3380b73392ea899fc1350a5b0 Mon Sep 17 00:00:00 2001 From: Alug Date: Sat, 13 Jun 2026 13:41:00 +0200 Subject: [PATCH 1/4] use sizeu1 instead of %lu windoze....... --- src/p_setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_setup.c b/src/p_setup.c index 95d3144b3..4423b7d26 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -1878,7 +1878,7 @@ static void P_LoadReject(UINT8 *data, size_t rejectsize) { if (rejectsize < neededsize) { - CONS_Alert(CONS_ERROR, "REJECT is %lu byte%s too small. REJECT might be invalid and might crash vanilla clients!\n", (neededsize - rejectsize), (neededsize - rejectsize) == 1 ? "" : "s"); + CONS_Alert(CONS_ERROR, "REJECT is %s byte%s too small. REJECT might be invalid and might crash vanilla clients!\n", sizeu1(neededsize - rejectsize), (neededsize - rejectsize) == 1 ? "" : "s"); allocsize = neededsize; } From e1061ab4b4db007518a3fabcf19cbdb4232251aa Mon Sep 17 00:00:00 2001 From: Alug Date: Sat, 13 Jun 2026 15:11:41 +0200 Subject: [PATCH 2/4] add PARANOIA cases for reject and blockmap stuff also see comment --- src/p_setup.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/p_setup.c b/src/p_setup.c index 4423b7d26..0be23b262 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -1740,15 +1740,23 @@ static boolean P_LoadRawBlockMap(UINT8 *data, size_t count) bmaporgx = blockmaplump[0]< Date: Mon, 15 Jun 2026 14:48:21 +0200 Subject: [PATCH 3/4] handle interrupt signals during CONS_Error also move stuff into smol inline function --- src/console.c | 2 ++ src/d_clisrv.c | 5 +---- src/d_main.c | 5 +---- src/f_wipe.c | 5 +---- src/i_system.h | 5 +++++ 5 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/console.c b/src/console.c index d02f68bb6..8ca29f901 100644 --- a/src/console.c +++ b/src/console.c @@ -1437,6 +1437,8 @@ void CONS_Error(const char *msg) // dirty quick hack, but for the good cause while (I_GetKey() != KEY_ENTER) { + I_HandleInterrupt(); + // Sleep so we don't take too much of cpu usage I_Sleep(1.f/TICRATE*1000); diff --git a/src/d_clisrv.c b/src/d_clisrv.c index d5f10daa3..7113f6ca9 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -2858,10 +2858,7 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic { INT32 key; - if (I_Interrupted()) - { - I_Quit(); - } + I_HandleInterrupt(); I_OsPolling(); diff --git a/src/d_main.c b/src/d_main.c index c9df6e441..be19da2de 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -726,10 +726,7 @@ void D_SRB2Loop(void) enterprecise = I_GetPreciseTime(); - if (I_Interrupted()) - { - I_Quit(); - } + I_HandleInterrupt(); memset(&g_dc, 0, sizeof(g_dc)); Z_Frame_Reset(); diff --git a/src/f_wipe.c b/src/f_wipe.c index 18100da4c..32b385c9e 100644 --- a/src/f_wipe.c +++ b/src/f_wipe.c @@ -361,10 +361,7 @@ void F_RunWipe(UINT8 wipetype, boolean drawMenu) // on for fade-to-black for (;;) { - if (I_Interrupted()) - { - I_Quit(); - } + I_HandleInterrupt(); // get fademask first so we can tell if it exists or not fmask = F_GetFadeMask(wipetype, wipeframe++); diff --git a/src/i_system.h b/src/i_system.h index 9457e9c6d..9e981cf0f 100644 --- a/src/i_system.h +++ b/src/i_system.h @@ -203,6 +203,11 @@ void I_ShutdownSystem(void); /** \brief To check if a Interrupt or Terminate Signal was fired */ boolean I_Interrupted(void); +static inline void I_HandleInterrupt(void) +{ + if (I_Interrupted()) + I_Quit(); +} /** \brief The I_GetDiskFreeSpace function From 96a29abc62e53f9cdd455fae517ad1743e9ca0df Mon Sep 17 00:00:00 2001 From: Alug Date: Mon, 15 Jun 2026 14:53:20 +0200 Subject: [PATCH 4/4] move this back might change behavior of this, which may desynch in rare cases --- src/p_sight.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/p_sight.c b/src/p_sight.c index 73c98f8f3..3eb4788b0 100644 --- a/src/p_sight.c +++ b/src/p_sight.c @@ -432,11 +432,6 @@ boolean P_CheckSight2(mobj_t *t1, mobj_t *t2, boolean fast) continue; } - if (rover->flags & FF_SOLID) - { - continue; // shortcut since neither mobj can be inside the 3dfloor - } - // Check for blocking floors here. topz2 = P_GetFFloorTopZAt (rover, t2->x, t2->y); @@ -457,6 +452,11 @@ boolean P_CheckSight2(mobj_t *t1, mobj_t *t2, boolean fast) return false; } + if (rover->flags & FF_SOLID) + { + continue; // shortcut since neither mobj can be inside the 3dfloor + } + if (rover->flags & FF_BOTHPLANES || !(rover->flags & FF_INVERTPLANES)) { if (los.sightzstart >= topz1 && t2->z + t2->height < topz2)