Better plan, use ?: for deciding between floorz/ceiling checks based on gravity

This commit is contained in:
Monster Iestyn 2017-02-03 20:13:16 +00:00
parent 659a62db88
commit 9a2b7b2091

View file

@ -6651,8 +6651,9 @@ void P_MobjThinker(mobj_t *mobj)
case MT_FALLINGROCK:
// Despawn rocks here in case zmovement code can't do so (blame slopes)
if (!mobj->momx && !mobj->momy && !mobj->momz
&& ((mobj->z <= mobj->floorz && !(mobj->eflags & MFE_VERTICALFLIP))
|| (mobj->z + mobj->height >= mobj->ceilingz && mobj->eflags & MFE_VERTICALFLIP)))
&& ((mobj->eflags & MFE_VERTICALFLIP) ?
mobj->z + mobj->height >= mobj->ceilingz
: mobj->z <= mobj->floorz))
{
P_RemoveMobj(mobj);
return;