From f6f9542d6e60b0d60087cb8a41e0a60d707c765a Mon Sep 17 00:00:00 2001 From: Alug Date: Tue, 23 Jul 2024 20:06:01 +0200 Subject: [PATCH] add cam check here --- src/p_mobj.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index b25a30065..5ac421e73 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3144,7 +3144,12 @@ static void P_SceneryCheckWater(mobj_t *mobj) static boolean P_CameraCheckHeat(camera_t *thiscam) { sector_t *sector; - fixed_t halfheight = thiscam->z + (thiscam->height >> 1); + fixed_t halfheight; + + if (!thiscam) + return false; + + halfheight = thiscam->z + (thiscam->height >> 1); // see if we are in water sector = thiscam->subsector->sector; @@ -3177,7 +3182,12 @@ static boolean P_CameraCheckHeat(camera_t *thiscam) static boolean P_CameraCheckWater(camera_t *thiscam) { sector_t *sector; - fixed_t halfheight = thiscam->z + (thiscam->height >> 1); + fixed_t halfheight; + + if (!thiscam) + return false; + + halfheight = thiscam->z + (thiscam->height >> 1); // see if we are in water sector = thiscam->subsector->sector;