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;