mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Merge branch 'acs-fix-fof-trigger' into 'master'
ACS: Fix "on enter" triggers on intangible FOFs See merge request KartKrew/Kart!1221
This commit is contained in:
commit
69b9805d5b
1 changed files with 16 additions and 2 deletions
18
src/p_spec.c
18
src/p_spec.c
|
|
@ -5730,6 +5730,10 @@ 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;
|
||||
fixed_t mid = 0;
|
||||
|
||||
roversec = rover->master->frontsector;
|
||||
|
||||
if (P_SectorActionIsContinuous(roversec) != continuous)
|
||||
|
|
@ -5744,6 +5748,16 @@ 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);
|
||||
mid = bottom + ((top - bottom) / 2);
|
||||
|
||||
if (mo->z > top || mo->z + mo->height < bottom)
|
||||
{
|
||||
// Out of bounds.
|
||||
continue;
|
||||
}
|
||||
|
||||
if (P_AllowSpecialEnter(roversec, mo) == false)
|
||||
{
|
||||
boolean floor = false;
|
||||
|
|
@ -5751,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) == P_GetSpecialTopZ(mo, roversec, roversec));
|
||||
floor = (P_GetMobjFeet(mo) >= mid);
|
||||
}
|
||||
|
||||
if (P_AllowSpecialCeiling(roversec, mo) == true)
|
||||
{
|
||||
ceiling = (P_GetMobjHead(mo) == P_GetSpecialBottomZ(mo, roversec, roversec));
|
||||
ceiling = (P_GetMobjHead(mo) <= mid);
|
||||
}
|
||||
|
||||
if (floor == false && ceiling == false)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue