From 86decbc78c2cebcc69127e0aedfdf5b1bfff8dcf Mon Sep 17 00:00:00 2001 From: Arthur <spaddlewit@gmail.com> Date: Tue, 20 Feb 2024 14:28:57 -0500 Subject: [PATCH] Check for null boundsec. I think we can also do without 'perfect' in P_CheckDeathPitCollide since this only truly kills non-player mobjs. --- src/p_mobj.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 27f41f2e9b..3000c66740 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -1124,7 +1124,7 @@ fixed_t P_MobjFloorZ(sector_t *sector, sector_t *boundsec, fixed_t x, fixed_t y, return P_GetSlopeZAt(slope, testx, testy); // If boundsec is set, we're looking for specials. In that case, iterate over every line in this sector to find the TRUE highest/lowest point - if (perfect) { + if (perfect && boundsec) { size_t i; line_t *ld; fixed_t bbox[4]; @@ -1200,7 +1200,7 @@ fixed_t P_MobjCeilingZ(sector_t *sector, sector_t *boundsec, fixed_t x, fixed_t return P_GetSlopeZAt(slope, testx, testy); // If boundsec is set, we're looking for specials. In that case, iterate over every line in this sector to find the TRUE highest/lowest point - if (perfect) { + if (perfect && boundsec) { size_t i; line_t *ld; fixed_t bbox[4]; @@ -2173,8 +2173,8 @@ boolean P_CheckDeathPitCollide(mobj_t *mo) if (mo->player && mo->player->pflags & PF_GODMODE) return false; - fixed_t sectorFloor = P_MobjFloorZ(mo->subsector->sector, NULL, mo->x, mo->y, mo->radius, NULL, false, true); - fixed_t sectorCeiling = P_MobjCeilingZ(mo->subsector->sector, NULL, mo->x, mo->y, mo->radius, NULL, true, true); + fixed_t sectorFloor = P_MobjFloorZ(mo->subsector->sector, NULL, mo->x, mo->y, mo->radius, NULL, false, false); + fixed_t sectorCeiling = P_MobjCeilingZ(mo->subsector->sector, NULL, mo->x, mo->y, mo->radius, NULL, true, false); if (((mo->z <= sectorFloor && ((mo->subsector->sector->flags & MSF_TRIGGERSPECIAL_HEADBUMP) || !(mo->eflags & MFE_VERTICALFLIP)) && (mo->subsector->sector->flags & MSF_FLIPSPECIAL_FLOOR)) -- GitLab