From ce712ae68d363a65d9ac420762ebe80df59bf99d Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Wed, 3 May 2023 18:40:23 -0400 Subject: [PATCH 1/2] ACS: Fix enter triggers on intangible FOFs --- src/p_spec.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/p_spec.c b/src/p_spec.c index 6ff65a00a..e12b87948 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -5730,6 +5730,9 @@ static void P_CheckMobj3DFloorAction(mobj_t *mo, sector_t *sec, boolean continuo for (rover = sec->ffloors; rover; rover = rover->next) { + fixed_t top = INT32_MIN; + fixed_t bottom = INT32_MAX; + roversec = rover->master->frontsector; if (P_SectorActionIsContinuous(roversec) != continuous) @@ -5744,6 +5747,14 @@ static void P_CheckMobj3DFloorAction(mobj_t *mo, sector_t *sec, boolean continuo continue; } + top = P_GetSpecialTopZ(mo, roversec, roversec); + bottom = P_GetSpecialBottomZ(mo, roversec, roversec); + + if (mo->z > top || mo->z + mo->height < bottom) + { + continue; + } + if (P_AllowSpecialEnter(roversec, mo) == false) { boolean floor = false; @@ -5751,12 +5762,12 @@ static void P_CheckMobj3DFloorAction(mobj_t *mo, sector_t *sec, boolean continuo if (P_AllowSpecialFloor(roversec, mo) == true) { - floor = (P_GetMobjFeet(mo) == P_GetSpecialTopZ(mo, roversec, roversec)); + floor = (P_GetMobjFeet(mo) == top); } if (P_AllowSpecialCeiling(roversec, mo) == true) { - ceiling = (P_GetMobjHead(mo) == P_GetSpecialBottomZ(mo, roversec, roversec)); + ceiling = (P_GetMobjHead(mo) == bottom); } if (floor == false && ceiling == false) From a7d22f8468f50eef78c19daa285dbdf9f9661f63 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Wed, 3 May 2023 19:11:08 -0400 Subject: [PATCH 2/2] 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)