From 021e7ed1f0b0eb94420554fb6ec7243eadc32cf4 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sun, 30 Jul 2017 17:45:27 +0100 Subject: [PATCH] Okay, actually fixed. Thanks, MI, for understanding the maths a little better than I :p --- src/p_map.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index 209df088c..d4d8796a2 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -988,10 +988,14 @@ static boolean PIT_CheckThing(mobj_t *thing) fixed_t bottomz, topz; angle_t touchangle = R_PointToAngle2(thing->tracer->x, thing->tracer->y, tmthing->x, tmthing->y); - if (P_PlayerInPain(tmthing->player) - && (tmthing->momx || tmthing->momy) - && (R_PointToAngle2(0, 0, tmthing->momx, tmthing->momy) - touchangle) > ANGLE_180) - return true; // Yes, this is intentionally outside the z-height check. No standing on spikes whilst moving away from them. + if (P_PlayerInPain(tmthing->player) && (tmthing->momx || tmthing->momy)) + { + angle_t playerangle = R_PointToAngle2(0, 0, tmthing->momx, tmthing->momy) - touchangle; + if (playerangle > ANGLE_180) + playerangle = InvAngle(playerangle); + if (playerangle < ANGLE_90) + return true; // Yes, this is intentionally outside the z-height check. No standing on spikes whilst moving away from them. + } bottomz = thing->z; topz = thing->z + thing->height;