From 93d0106c28bcb9d2becabd9fd677ca16f54f6a47 Mon Sep 17 00:00:00 2001 From: Alug Date: Wed, 22 Oct 2025 10:38:22 +0200 Subject: [PATCH 1/4] remove erronous ";" --- src/d_netcmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 002195ec1..a99ece58a 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -4472,7 +4472,7 @@ static void Command_Addfile(void) if (IsPlayerAdmin(consoleplayer) && (!server)) // Request to add file SendNetXCmd(XD_REQADDFILE, buf, buf_p - buf); else - SendNetXCmd(XD_ADDFILE, buf, buf_p - buf);; + SendNetXCmd(XD_ADDFILE, buf, buf_p - buf); } /** Adds something at runtime. From ab27090ecf985c461a933d68a40447fa2ab4900e Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 21 Oct 2025 20:48:22 +0100 Subject: [PATCH 2/4] Don't send a netxcmd when using addfile outside of netgame Was supposed to be happening already, but `multiplayer` is a useless variable... --- src/d_netcmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index a99ece58a..65dd1d4cf 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -4429,7 +4429,7 @@ static void Command_Addfile(void) } // Add file on your client directly if it is trivial, or you aren't in a netgame. - if (!(netgame || multiplayer) || musiconly) + if (!netgame || musiconly) { P_AddWadFile(fn, false); return; From a94740f5e9b9cb9cb4fd91ad668c4d04c8e5afa6 Mon Sep 17 00:00:00 2001 From: AJ Martinez Date: Sun, 26 Feb 2023 04:29:13 -0700 Subject: [PATCH 3/4] Fix unsteady camera movement in demos --- src/p_user.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index a5c01152a..b99998844 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -3315,7 +3315,7 @@ static ticcmd_t *P_CameraCmd(camera_t *cam, UINT8 num) cmd->sidemove = (SINT8)(cmd->sidemove + side); } - lang += (cmd->angleturn<<16); + lang += (cmd->angleturn << 16); cam->localangle = lang; if (!cam->reset_aiming) @@ -3821,7 +3821,13 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall if (demo.playback) { - focusangle = mo->angle; + // Hack-adjacent. + // Sometimes stale ticcmds send a weird angle at the start of the race. + // P_UpdatePlayerAngle knows to ignore cmd angle when you literally can't turn, so we do the same here. + if (leveltime > starttime) + focusangle = player->cmd.angleturn << 16; + else + focusangle = mo->angle; // Just use something known sane. focusaiming = 0; } else if (P_IsLocalPlayer(player)) From 77f4d4ef3bd55528043cfcc52b730bc023b03364 Mon Sep 17 00:00:00 2001 From: Alug Date: Wed, 22 Oct 2025 13:42:33 +0200 Subject: [PATCH 4/4] fix replays occasionally crashing when stopping due to R_ReInitColormaps our extra_colormaps pointer may be freed so ensure it only gets called after gamestate has been set to GS_NULL so we dont risk doing this mid renderframe fixes crashes in software and palette render mode --- src/g_demo.c | 11 ++++++----- src/r_main.cpp | 3 ++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/g_demo.c b/src/g_demo.c index 6b2c8f1c9..de8523ae9 100644 --- a/src/g_demo.c +++ b/src/g_demo.c @@ -3411,11 +3411,6 @@ void G_StopDemo(void) demo.rewinding = false; CL_ClearRewinds(); - if (gamestate == GS_LEVEL && rendermode != render_none) - { - V_SetPaletteLump("PLAYPAL"); // Reset the palette - R_ReInitColormaps(0, LUMPERROR); - } if (gamestate == GS_INTERMISSION) Y_EndIntermission(); // cleanup if (gamestate == GS_VOTING) @@ -3427,6 +3422,12 @@ void G_StopDemo(void) wipegamestate = GS_NULL; SV_StopServer(); SV_ResetServer(); + + if (gamestate == GS_LEVEL && rendermode != render_none) + { + V_SetPaletteLump("PLAYPAL"); // Reset the palette + R_ReInitColormaps(0, LUMPERROR); + } } // Stops timing a demo. diff --git a/src/r_main.cpp b/src/r_main.cpp index a340ef29c..5313357d6 100644 --- a/src/r_main.cpp +++ b/src/r_main.cpp @@ -943,9 +943,10 @@ void R_ExecuteSetViewSize(void) memset(scalelight, 0xFF, sizeof(scalelight)); // Calculate the light levels to use for each level/scale combination. - for (i = 0; i< LIGHTLEVELS; i++) + for (i = 0; i < LIGHTLEVELS; i++) { startmapl = ((LIGHTLEVELS - 1 - i)*2)*NUMCOLORMAPS/LIGHTLEVELS; + for (j = 0; j < MAXLIGHTSCALE; j++) { level = startmapl - j*vid.width/(viewwidth)/DISTMAP;