mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-26 12:01:47 +00:00
ACS: Fix floor & ceiling FOF triggers
This commit is contained in:
parent
ce712ae68d
commit
a7d22f8468
1 changed files with 5 additions and 2 deletions
|
|
@ -5732,6 +5732,7 @@ static void P_CheckMobj3DFloorAction(mobj_t *mo, sector_t *sec, boolean continuo
|
||||||
{
|
{
|
||||||
fixed_t top = INT32_MIN;
|
fixed_t top = INT32_MIN;
|
||||||
fixed_t bottom = INT32_MAX;
|
fixed_t bottom = INT32_MAX;
|
||||||
|
fixed_t mid = 0;
|
||||||
|
|
||||||
roversec = rover->master->frontsector;
|
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);
|
top = P_GetSpecialTopZ(mo, roversec, roversec);
|
||||||
bottom = P_GetSpecialBottomZ(mo, roversec, roversec);
|
bottom = P_GetSpecialBottomZ(mo, roversec, roversec);
|
||||||
|
mid = bottom + ((top - bottom) / 2);
|
||||||
|
|
||||||
if (mo->z > top || mo->z + mo->height < bottom)
|
if (mo->z > top || mo->z + mo->height < bottom)
|
||||||
{
|
{
|
||||||
|
// Out of bounds.
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -5762,12 +5765,12 @@ static void P_CheckMobj3DFloorAction(mobj_t *mo, sector_t *sec, boolean continuo
|
||||||
|
|
||||||
if (P_AllowSpecialFloor(roversec, mo) == true)
|
if (P_AllowSpecialFloor(roversec, mo) == true)
|
||||||
{
|
{
|
||||||
floor = (P_GetMobjFeet(mo) == top);
|
floor = (P_GetMobjFeet(mo) >= mid);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (P_AllowSpecialCeiling(roversec, mo) == true)
|
if (P_AllowSpecialCeiling(roversec, mo) == true)
|
||||||
{
|
{
|
||||||
ceiling = (P_GetMobjHead(mo) == bottom);
|
ceiling = (P_GetMobjHead(mo) <= mid);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (floor == false && ceiling == false)
|
if (floor == false && ceiling == false)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue