From 8eb4afbbe2471b59d0a391e442d6ffd2d66bae50 Mon Sep 17 00:00:00 2001 From: Alaux <73968015+MrAlaux@users.noreply.github.com> Date: Sun, 26 Nov 2023 20:26:45 -0300 Subject: [PATCH] Don't perform fake movement for `P_Move()` checks --- src/p_enemy.c | 4 ++-- src/p_map.c | 4 ++-- src/p_map.h | 2 +- src/p_mobj.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/p_enemy.c b/src/p_enemy.c index dc65d4e72..016244e9e 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -414,7 +414,7 @@ static boolean P_Move(mobj_t *actor, boolean dropoff) // killough 9/12/98 actor->z += FLOATSPEED; // [Nugget] - if ((onmo = P_CheckOnmobj(actor))) + if ((onmo = P_CheckOnmobj(actor, false))) { actor->z = onmo->z - actor->height; } } else @@ -422,7 +422,7 @@ static boolean P_Move(mobj_t *actor, boolean dropoff) // killough 9/12/98 actor->z -= FLOATSPEED; // [Nugget] - if ((onmo = P_CheckOnmobj(actor))) + if ((onmo = P_CheckOnmobj(actor, false))) { actor->z = onmo->z + onmo->height; } } diff --git a/src/p_map.c b/src/p_map.c index 5ed314ae7..3233c3204 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -2544,7 +2544,7 @@ static void P_FakeZMovement(mobj_t *mo) } // Checks if the new Z position is legal -mobj_t *P_CheckOnmobj(mobj_t *thing) +mobj_t *P_CheckOnmobj(mobj_t *thing, boolean fakemove) { int xl, xh, yl, yh, bx, by; subsector_t *newsubsec; @@ -2584,7 +2584,7 @@ mobj_t *P_CheckOnmobj(mobj_t *thing) yl = (tmbbox[BOXBOTTOM] - bmaporgy - MAXRADIUS) >> MAPBLOCKSHIFT; yh = (tmbbox[BOXTOP] - bmaporgy + MAXRADIUS) >> MAPBLOCKSHIFT; - P_FakeZMovement(tmthing); + if (fakemove) { P_FakeZMovement(tmthing); } for (bx = xl; bx <= xh; bx++) for (by = yl; by <= yh; by++) diff --git a/src/p_map.h b/src/p_map.h index ad591fafd..f92f60524 100644 --- a/src/p_map.h +++ b/src/p_map.h @@ -78,7 +78,7 @@ extern msecnode_t *sector_list; // phares 3/16/98 extern fixed_t tmbbox[4]; // phares 3/20/98 extern line_t *blockline; // killough 8/11/98 -mobj_t *P_CheckOnmobj(mobj_t *thing); // [Nugget]: [DSDA] +mobj_t *P_CheckOnmobj(mobj_t *thing, boolean fakemove); // [Nugget]: [DSDA] extern boolean boomshot; // [Nugget] Explosive hitscan cheat diff --git a/src/p_mobj.c b/src/p_mobj.c index 94d772e2b..c87db2a0e 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -794,7 +794,7 @@ void P_MobjThinker (mobj_t* mobj) { mobj_t *onmo; - if (!(onmo = P_CheckOnmobj(mobj))) + if (!(onmo = P_CheckOnmobj(mobj, true))) { P_ZMovement(mobj); mobj->intflags &= ~MIF_ONMOBJ;