mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-15 09:11:48 +00:00
Fix players and pushables not accounting for slopes on bustable FOFs
This commit is contained in:
parent
eae47c9808
commit
8f02c50c10
2 changed files with 24 additions and 17 deletions
19
src/p_mobj.c
19
src/p_mobj.c
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
22
src/p_user.c
22
src/p_user.c
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue