From 65e6e54e7d5c014939f95eba53d750d0e70e80f9 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Mon, 19 Dec 2022 04:39:46 -0500 Subject: [PATCH] Alter MF_NOCLIP behavior - Things with MF_NOCLIP can still run code when touching things, but won't be blocked by them. - Things need both (MF_NOCLIP|MF_NOCLIPTHING) to do a single movement step, since MF_NOCLIP can do thing collision now. --- src/p_map.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index a581d4576..028566722 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -2131,9 +2131,6 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y, TryMoveResult_t *re // reset special lines numspechit = 0U; - if (tm.flags & MF_NOCLIP) - return true; - // Check things first, possibly picking things up. // MF_NOCLIPTHING: used by camera to not be blocked by things @@ -2160,6 +2157,15 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y, TryMoveResult_t *re } } + if (tm.flags & MF_NOCLIP) + { + // Sal 12/19/2022 -- PIT_CheckThing code will still run + // with MF_NOCLIP enabled, but they won't be blocked + // regardless of the result. This allows for SPBs and + // the UFO to collide. + return true; + } + validcount++; // check lines @@ -2628,7 +2634,10 @@ increment_move radius = min(radius, 16*mapobjectscale); do { - if (thing->flags & MF_NOCLIP) + // Sal 12/19/2022 -- PIT_CheckThing code now runs + // with MF_NOCLIP enabled, so we want step-by-step + // for anything that doesn't have both enabled. + if ((thing->flags & (MF_NOCLIP|MF_NOCLIPTHING)) == (MF_NOCLIP|MF_NOCLIPTHING)) { tryx = x; tryy = y;