Merge branch 'more-slope-fixes' into 'next'

More slope fixes (aka sorry guys I made another quick SUGOI fix)

Another slopes fix branch!

This branch currently includes a fix for:
* Knuckles gliding into a slope while in 2D mode causes him to try to "climb" on air above them, if the original non-sloped height is higher. Unfortunately he still tries to grab onto places that he can't really climb on, but at least now it's on the slope itself and not in mid-air lol. This issue is encountered in SUGOI's Retro Hill Zone, if you want to check for yourselves.
* Bustable FOF-busting code for both players AND pushables not accounting for slopes
* (Unrelated to slopes): Fix FF_SHATTERBOTTOM FOFs acting like THZ goop when stood on; I added this fix as a bonus because I encountered it in a test map of mine for the bustables fix

(Other fixes may or may not appear here in the near future, I haven't decided yet. Don't wait on me to get in any further fixes before merging, that said)

See merge request !110
This commit is contained in:
Wolfy 2016-09-04 19:34:29 -04:00
commit 484bb9535c
3 changed files with 42 additions and 31 deletions

View file

@ -1271,7 +1271,7 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y)
topheight = P_GetFOFTopZ(thing, newsubsec->sector, rover, x, y, NULL);
bottomheight = P_GetFOFBottomZ(thing, newsubsec->sector, rover, x, y, NULL);
if (rover->flags & FF_GOOWATER && !(thing->flags & MF_NOGRAVITY))
if ((rover->flags & (FF_SWIMMABLE|FF_GOOWATER)) == (FF_SWIMMABLE|FF_GOOWATER) && !(thing->flags & MF_NOGRAVITY))
{
// If you're inside goowater and slowing down
fixed_t sinklevel = FixedMul(thing->info->height/6, thing->scale);

View file

@ -1553,6 +1553,7 @@ static void P_PushableCheckBustables(mobj_t *mo)
if (node->m_sector->ffloors)
{
ffloor_t *rover;
fixed_t topheight, bottomheight;
for (rover = node->m_sector->ffloors; rover; rover = rover->next)
{
@ -1565,37 +1566,39 @@ static void P_PushableCheckBustables(mobj_t *mo)
if (!rover->master->frontsector->crumblestate)
{
topheight = P_GetFOFTopZ(mo, node->m_sector, rover, mo->x, mo->y, NULL);
bottomheight = P_GetFOFBottomZ(mo, node->m_sector, rover, mo->x, mo->y, NULL);
// Height checks
if (rover->flags & FF_SHATTERBOTTOM)
{
if (mo->z+mo->momz + mo->height < *rover->bottomheight)
if (mo->z+mo->momz + mo->height < bottomheight)
continue;
if (mo->z+mo->height > *rover->bottomheight)
if (mo->z+mo->height > bottomheight)
continue;
}
else if (rover->flags & FF_SPINBUST)
{
if (mo->z+mo->momz > *rover->topheight)
if (mo->z+mo->momz > topheight)
continue;
if (mo->z+mo->height < *rover->bottomheight)
if (mo->z+mo->height < bottomheight)
continue;
}
else if (rover->flags & FF_SHATTER)
{
if (mo->z+mo->momz > *rover->topheight)
if (mo->z+mo->momz > topheight)
continue;
if (mo->z+mo->momz + mo->height < *rover->bottomheight)
if (mo->z+mo->momz + mo->height < bottomheight)
continue;
}
else
{
if (mo->z >= *rover->topheight)
if (mo->z >= topheight)
continue;
if (mo->z+mo->height < *rover->bottomheight)
if (mo->z+mo->height < bottomheight)
continue;
}

View file

@ -1692,6 +1692,7 @@ static void P_CheckBustableBlocks(player_t *player)
if (node->m_sector->ffloors)
{
ffloor_t *rover;
fixed_t topheight, bottomheight;
for (rover = node->m_sector->ffloors; rover; rover = rover->next)
{
@ -1717,42 +1718,45 @@ static void P_CheckBustableBlocks(player_t *player)
if (!(rover->flags & FF_SHATTER) && (rover->flags & FF_ONLYKNUX) && !(player->charability == CA_GLIDEANDCLIMB))
continue;
topheight = P_GetFOFTopZ(player->mo, node->m_sector, rover, player->mo->x, player->mo->y, NULL);
bottomheight = P_GetFOFBottomZ(player->mo, node->m_sector, rover, player->mo->x, player->mo->y, NULL);
// Height checks
if (rover->flags & FF_SHATTERBOTTOM)
{
if (player->mo->z+player->mo->momz + player->mo->height < *rover->bottomheight)
if (player->mo->z+player->mo->momz + player->mo->height < bottomheight)
continue;
if (player->mo->z+player->mo->height > *rover->bottomheight)
if (player->mo->z+player->mo->height > bottomheight)
continue;
}
else if (rover->flags & FF_SPINBUST)
{
if (player->mo->z+player->mo->momz > *rover->topheight)
if (player->mo->z+player->mo->momz > topheight)
continue;
if (player->mo->z + player->mo->height < *rover->bottomheight)
if (player->mo->z + player->mo->height < bottomheight)
continue;
}
else if (rover->flags & FF_SHATTER)
{
if (player->mo->z + player->mo->momz > *rover->topheight)
if (player->mo->z + player->mo->momz > topheight)
continue;
if (player->mo->z+player->mo->momz + player->mo->height < *rover->bottomheight)
if (player->mo->z+player->mo->momz + player->mo->height < bottomheight)
continue;
}
else
{
if (player->mo->z >= *rover->topheight)
if (player->mo->z >= topheight)
continue;
if (player->mo->z + player->mo->height < *rover->bottomheight)
if (player->mo->z + player->mo->height < bottomheight)
continue;
}
// Impede the player's fall a bit
if (((rover->flags & FF_SPINBUST) || (rover->flags & FF_SHATTER)) && player->mo->z >= *rover->topheight)
if (((rover->flags & FF_SPINBUST) || (rover->flags & FF_SHATTER)) && player->mo->z >= topheight)
player->mo->momz >>= 1;
else if (rover->flags & FF_SHATTER)
{
@ -6976,6 +6980,7 @@ static void P_MovePlayer(player_t *player)
msecnode_t *node; // only place it's being used in P_MovePlayer now
fixed_t oldx;
fixed_t oldy;
fixed_t floorz, ceilingz;
oldx = player->mo->x;
oldy = player->mo->y;
@ -6993,31 +6998,34 @@ static void P_MovePlayer(player_t *player)
if (node->m_sector->ffloors)
{
ffloor_t *rover;
fixed_t topheight, bottomheight;
for (rover = node->m_sector->ffloors; rover; rover = rover->next)
{
if (!(rover->flags & FF_EXISTS)) continue;
if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_BLOCKPLAYER))
continue;
if ((rover->flags & FF_BLOCKPLAYER))
topheight = P_GetFOFTopZ(player->mo, node->m_sector, rover, player->mo->x, player->mo->y, NULL);
bottomheight = P_GetFOFBottomZ(player->mo, node->m_sector, rover, player->mo->x, player->mo->y, NULL);
if (topheight > player->mo->z && bottomheight < player->mo->z)
{
if (*rover->topheight > player->mo->z && *rover->bottomheight < player->mo->z)
{
P_ResetPlayer(player);
S_StartSound(player->mo, sfx_s3k4a);
player->climbing = 5;
player->mo->momx = player->mo->momy = player->mo->momz = 0;
break;
}
P_ResetPlayer(player);
S_StartSound(player->mo, sfx_s3k4a);
player->climbing = 5;
player->mo->momx = player->mo->momy = player->mo->momz = 0;
break;
}
}
}
if (player->mo->z+player->mo->height > node->m_sector->ceilingheight
floorz = P_GetFloorZ(player->mo, node->m_sector, player->mo->x, player->mo->y, NULL);
ceilingz = P_GetCeilingZ(player->mo, node->m_sector, player->mo->x, player->mo->y, NULL);
if (player->mo->z+player->mo->height > ceilingz
&& node->m_sector->ceilingpic == skyflatnum)
continue;
if (node->m_sector->floorheight > player->mo->z
|| node->m_sector->ceilingheight < player->mo->z)
if (floorz > player->mo->z || ceilingz < player->mo->z)
{
P_ResetPlayer(player);
S_StartSound(player->mo, sfx_s3k4a);