From 3fbede8eb2d4a83afc18bcfe44257d494f4ad785 Mon Sep 17 00:00:00 2001 From: toaster Date: Thu, 23 Mar 2023 21:26:55 +0000 Subject: [PATCH] Obj_PlayerUFOCollide: Apply height checks even when boosting --- src/objects/ufo.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/objects/ufo.c b/src/objects/ufo.c index f4c9b42bb..268ea8f00 100644 --- a/src/objects/ufo.c +++ b/src/objects/ufo.c @@ -723,6 +723,16 @@ void Obj_PlayerUFOCollide(mobj_t *ufo, mobj_t *other) return; } + if (other->z > ufo->z + ufo->height) + { + return; // overhead + } + + if (other->z + other->height < ufo->z) + { + return; // underneath + } + if ((other->player->sneakertimer > 0) && !P_PlayerInPain(other->player) && (other->player->flashing == 0)) @@ -737,16 +747,6 @@ void Obj_PlayerUFOCollide(mobj_t *ufo, mobj_t *other) const angle_t moveAngle = K_MomentumAngle(ufo); const angle_t clipAngle = R_PointToAngle2(ufo->x, ufo->y, other->x, other->y); - if (other->z > ufo->z + ufo->height) - { - return; // overhead - } - - if (other->z + other->height < ufo->z) - { - return; // underneath - } - if (AngleDelta(moveAngle, clipAngle) < ANG60) { // in front