From a7d22f8468f50eef78c19daa285dbdf9f9661f63 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Wed, 3 May 2023 19:11:08 -0400 Subject: [PATCH] ACS: Fix floor & ceiling FOF triggers --- src/p_spec.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/p_spec.c b/src/p_spec.c index e12b87948..eaa400849 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -5732,6 +5732,7 @@ static void P_CheckMobj3DFloorAction(mobj_t *mo, sector_t *sec, boolean continuo { fixed_t top = INT32_MIN; fixed_t bottom = INT32_MAX; + fixed_t mid = 0; roversec = rover->master->frontsector; @@ -5749,9 +5750,11 @@ static void P_CheckMobj3DFloorAction(mobj_t *mo, sector_t *sec, boolean continuo top = P_GetSpecialTopZ(mo, roversec, roversec); bottom = P_GetSpecialBottomZ(mo, roversec, roversec); + mid = bottom + ((top - bottom) / 2); if (mo->z > top || mo->z + mo->height < bottom) { + // Out of bounds. continue; } @@ -5762,12 +5765,12 @@ static void P_CheckMobj3DFloorAction(mobj_t *mo, sector_t *sec, boolean continuo if (P_AllowSpecialFloor(roversec, mo) == true) { - floor = (P_GetMobjFeet(mo) == top); + floor = (P_GetMobjFeet(mo) >= mid); } if (P_AllowSpecialCeiling(roversec, mo) == true) { - ceiling = (P_GetMobjHead(mo) == bottom); + ceiling = (P_GetMobjHead(mo) <= mid); } if (floor == false && ceiling == false)