Make the crumble check account for slopes for... some reason

This commit is contained in:
RedEnchilada 2015-05-21 10:17:53 -05:00
parent 3d2b71b24c
commit e24595ed52
1 changed files with 6 additions and 2 deletions

View File

@ -4077,6 +4077,7 @@ static void P_PlayerMobjThinker(mobj_t *mobj)
// Crumbling platforms
for (node = mobj->touching_sectorlist; node; node = node->m_snext)
{
fixed_t topheight, bottomheight;
ffloor_t *rover;
for (rover = node->m_sector->ffloors; rover; rover = rover->next)
@ -4084,8 +4085,11 @@ static void P_PlayerMobjThinker(mobj_t *mobj)
if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_CRUMBLE))
continue;
if ((*rover->topheight == mobj->z && !(mobj->eflags & MFE_VERTICALFLIP))
|| (*rover->bottomheight == mobj->z + mobj->height && mobj->eflags & MFE_VERTICALFLIP)) // You nut.
topheight = P_GetFOFTopZ(mobj, node->m_sector, rover, mobj->x, mobj->y, NULL);
bottomheight = P_GetFOFBottomZ(mobj, node->m_sector, rover, mobj->x, mobj->y, NULL);
if ((topheight <= mobj->z + 16*mobj->scale && topheight >= mobj->z && !(mobj->eflags & MFE_VERTICALFLIP))
|| (bottomheight >= mobj->z + mobj->height && bottomheight <= mobj->z + mobj->height - 16*mobj->scale && mobj->eflags & MFE_VERTICALFLIP)) // You nut.
EV_StartCrumble(rover->master->frontsector, rover, (rover->flags & FF_FLOATBOB), mobj->player, rover->alpha, !(rover->flags & FF_NORETURN));
}
}