From acb6e30fadca8818c3e024e8d362ad5d9a66141d Mon Sep 17 00:00:00 2001 From: Alug Date: Mon, 19 Feb 2024 18:20:11 +0100 Subject: [PATCH] dont apply this for players --- src/p_mobj.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 7df407db7..b31fb2dfe 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -791,8 +791,16 @@ fixed_t P_MobjFloorZ(mobj_t *mobj, sector_t *sector, sector_t *boundsec, fixed_t testy += y; // If the highest point is in the sector, then we have it easy! Just get the Z at that point - if (R_IsPointInSector(boundsec ? boundsec : sector, testx, testy)) - return P_GetZAt(slope, testx, testy); + if (mobj->player) + { + if (R_PointInSubsector(testx, testy)->sector == (boundsec ? boundsec : sector)) + return P_GetZAt(slope, testx, testy); + } + else + { + if (R_IsPointInSector(boundsec ? boundsec : sector, testx, testy)) + return P_GetZAt(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) { @@ -867,8 +875,16 @@ fixed_t P_MobjCeilingZ(mobj_t *mobj, sector_t *sector, sector_t *boundsec, fixed testy += y; // If the highest point is in the sector, then we have it easy! Just get the Z at that point - if (R_IsPointInSector(boundsec ? boundsec : sector, testx, testy)) - return P_GetZAt(slope, testx, testy); + if (mobj->player) + { + if (R_PointInSubsector(testx, testy)->sector == (boundsec ? boundsec : sector)) + return P_GetZAt(slope, testx, testy); + } + else + { + if (R_IsPointInSector(boundsec ? boundsec : sector, testx, testy)) + return P_GetZAt(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) {