check for cam subsector

since we can move it around and i added this to freecam mode, subsector may be null for reason so better be safe than sorry
This commit is contained in:
Alug committed 2025-01-07 16:31:04 +01:00
1 parent c8737bd43f
commit 03e45f4590
1 file changed
+2 -2
+2 -2
View File
@@ -3141,7 +3141,7 @@ static boolean P_CameraCheckHeat(camera_t *thiscam)
sector_t *sector;
fixed_t halfheight;
if (!thiscam)
if (!thiscam || !thiscam->subsector)
return false;
halfheight = thiscam->z + (thiscam->height >> 1);
@@ -3179,7 +3179,7 @@ static boolean P_CameraCheckWater(camera_t *thiscam)
sector_t *sector;
fixed_t halfheight;
if (!thiscam)
if (!thiscam || !thiscam->subsector)
return false;
halfheight = thiscam->z + (thiscam->height >> 1);