Skip to content

Commit

Permalink
Don't perform fake movement for P_Move() checks
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAlaux committed Nov 26, 2023
1 parent 1e60f24 commit 8eb4afb
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/p_enemy.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,15 +414,15 @@ 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
{
actor->z -= FLOATSPEED;

// [Nugget]
if ((onmo = P_CheckOnmobj(actor)))
if ((onmo = P_CheckOnmobj(actor, false)))
{ actor->z = onmo->z + onmo->height; }
}

Expand Down
4 changes: 2 additions & 2 deletions src/p_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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++)
Expand Down
2 changes: 1 addition & 1 deletion src/p_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/p_mobj.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8eb4afb

Please sign in to comment.