From 9a2b7b2091a462e4eeed1ad7f957738e628ff4b2 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Fri, 3 Feb 2017 20:13:16 +0000 Subject: [PATCH] Better plan, use ?: for deciding between floorz/ceiling checks based on gravity --- src/p_mobj.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 5d4defb4..fb864801 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -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;