Fix quicksand in reverse gravity

This commit is contained in:
spherallic 2022-09-12 11:27:28 +02:00
parent 3427d4309f
commit 9499d16221
3 changed files with 19 additions and 4 deletions

View file

@ -2127,7 +2127,7 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y)
if (rover->flags & FF_QUICKSAND)
{
if (thing->z < topheight && bottomheight < thingtop)
if (!(thing->eflags & MFE_VERTICALFLIP) && thing->z < topheight && bottomheight < thingtop)
{
if (tmfloorz < thing->z) {
tmfloorz = thing->z;
@ -2135,6 +2135,14 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y)
tmfloorslope = NULL;
}
}
else if (thing->eflags & MFE_VERTICALFLIP && thingtop < topheight && bottomheight < thing->z)
{
if (tmceilingz < thingtop) {
tmceilingz = thingtop;
tmceilingrover = rover;
tmceilingslope = NULL;
}
}
// Quicksand blocks never change heights otherwise.
continue;
}

View file

@ -2172,15 +2172,20 @@ void P_AdjustMobjFloorZ_FFloors(mobj_t *mo, sector_t *sector, UINT8 motype)
case 2: // scenery does things differently for some reason
if (mo->z < topheight && bottomheight < thingtop)
{
mo->floorz = mo->z;
if (!(mo->eflags & MFE_VERTICALFLIP))
mo->floorz = mo->z;
else if (mo->eflags & MFE_VERTICALFLIP)
mo->ceilingz = thingtop;
continue;
}
break;
default:
if (mo->z < topheight && bottomheight < thingtop)
{
if (mo->floorz < mo->z)
if (!(mo->eflags & MFE_VERTICALFLIP) && mo->floorz < mo->z)
mo->floorz = mo->z;
else if (mo->eflags & MFE_VERTICALFLIP && mo->ceilingz > thingtop)
mo->ceilingz = thingtop;
}
continue; // This is so you can jump/spring up through quicksand from below.
}

View file

@ -2814,7 +2814,9 @@ static void P_CheckQuicksand(player_t *player)
fixed_t sinkspeed;
fixed_t topheight, bottomheight;
if (!(player->mo->subsector->sector->ffloors && player->mo->momz <= 0))
if (!(player->mo->subsector->sector->ffloors &&
((!(player->mo->eflags & MFE_VERTICALFLIP) && player->mo->momz <= 0) ||
(player->mo->eflags & MFE_VERTICALFLIP && player->mo->momz >= 0))))
return;
for (rover = player->mo->subsector->sector->ffloors; rover; rover = rover->next)