From 327cca2e8e7da6760a5f3e352d60725b6df46bd8 Mon Sep 17 00:00:00 2001 From: Alug Date: Tue, 2 Dec 2025 12:47:45 +0100 Subject: [PATCH] change freecam condition for awayview shouldnt change the behavior much as we wont see anything without a camera, but this is explicit about what exactly is wanted (i.e. thiscam may be null, we only check due to null deref, we only care about if freecam is active) --- src/p_floor.c | 3 +-- src/r_main.cpp | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/p_floor.c b/src/p_floor.c index 856d14f09..bd7a2655e 100644 --- a/src/p_floor.c +++ b/src/p_floor.c @@ -687,8 +687,7 @@ void T_ContinuousFalling(levelspecthink_t *faller) // P_SectorCheckWater // // Like P_MobjCheckWater, but takes a sector instead of a mobj. -static fixed_t P_SectorCheckWater(sector_t *analyzesector, - sector_t *elevatorsec) +static fixed_t P_SectorCheckWater(sector_t *analyzesector, sector_t *elevatorsec) { fixed_t watertop; diff --git a/src/r_main.cpp b/src/r_main.cpp index e055a7e09..1ad8e8be9 100644 --- a/src/r_main.cpp +++ b/src/r_main.cpp @@ -1111,7 +1111,7 @@ static void R_SetupCommonFrame(player_t * player) static void R_SetupAimingFrame(player_t *player, camera_t *thiscam) { if (player->awayviewtics && player->awayviewmobj - && thiscam && !thiscam->freecam) // dont force this if we wanna freecam! + && !(thiscam && thiscam->freecam)) // dont force this if we wanna freecam! { newview->aim = player->awayviewaiming; newview->angle = player->awayviewmobj->angle; @@ -1279,7 +1279,7 @@ void R_SetupFrame(UINT8 pnum, boolean skybox) R_SetupAimingFrame(player, thiscam); if (player->awayviewtics && player->awayviewmobj // cut-away view stuff - && thiscam && !thiscam->freecam) // dont force this when we wanna freecam! + && !(thiscam && thiscam->freecam)) // dont force this when we wanna freecam! { viewmobj = player->awayviewmobj; // should be a MT_ALTVIEWMAN whos altview man? I_Assert(viewmobj != NULL);