From 2909b6887299ab59143ce4c815ccae68e1633351 Mon Sep 17 00:00:00 2001 From: Alug Date: Sat, 5 Oct 2024 08:35:35 +0200 Subject: [PATCH] smol fix --- src/g_game.c | 14 +++++++++----- src/p_tick.c | 4 ++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 1850fc520..24a1c08d2 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2055,18 +2055,22 @@ void G_ResetView(UINT8 viewnum, INT32 playernum, boolean onlyactive) /* Focus our target view first so that we don't take its player. */ (*displayplayerp) = playernum; - if ((*displayplayerp) != olddisplayplayer) - { - G_FixCamera(viewnum); - } + /* If a viewpoint changes, reset the camera to clear uninitialized memory. */ if (viewnum > splits) { - for (viewd = splits+1; viewd < viewnum; ++viewd) + for (viewd = splits+1; viewd <= viewnum; ++viewd) { G_FixCamera(viewd); } } + else + { + if ((*displayplayerp) != olddisplayplayer) + { + G_FixCamera(viewnum); + } + } if (viewnum == 1 && demo.playback) consoleplayer = displayplayers[0]; diff --git a/src/p_tick.c b/src/p_tick.c index f8bd06e63..3faafd38f 100644 --- a/src/p_tick.c +++ b/src/p_tick.c @@ -693,8 +693,10 @@ void P_Ticker(boolean run) { player_t *player = &players[displayplayers[i]]; boolean isSkyVisibleForPlayer = skyVisiblePerPlayer[i]; + if (!player->mo) continue; + if (isSkyVisibleForPlayer && skyboxmo[0] && cv_skybox.value) { R_SkyboxFrame(player); @@ -708,8 +710,6 @@ void P_Ticker(boolean run) if (demo.playback) G_StoreRewindInfo(); - -// Z_CheckMemCleanup(); } // Abbreviated ticker for pre-loading, calls thinkers and assorted things