From 9e9e3f4cca16e0cbe473220f4798216b6256a637 Mon Sep 17 00:00:00 2001 From: spherallic Date: Mon, 12 Sep 2022 14:00:17 +0200 Subject: [PATCH] Correct ceilingz handling in quicksand --- src/p_map.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index ebefeb939..ec0327970 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -2135,9 +2135,9 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y) tmfloorslope = NULL; } } - else if (thing->eflags & MFE_VERTICALFLIP && thingtop < topheight && bottomheight < thing->z) + else if (thing->eflags & MFE_VERTICALFLIP && thing->z < topheight && bottomheight < thingtop) { - if (tmceilingz < thingtop) { + if (tmceilingz > thingtop) { tmceilingz = thingtop; tmceilingrover = rover; tmceilingslope = NULL; @@ -5101,8 +5101,8 @@ fixed_t P_CeilingzAtPos(fixed_t x, fixed_t y, fixed_t z, fixed_t height) { if (thingtop > bottomheight && topheight > z) { - if (ceilingz > z) - ceilingz = z; + if (ceilingz > thingtop) + ceilingz = thingtop; } continue; }