Skip to content

Commit

Permalink
Track scrolling for ledgeblock
Browse files Browse the repository at this point in the history
  • Loading branch information
kraflab committed Apr 23, 2021
1 parent 86e36ce commit db8c3d6
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
7 changes: 5 additions & 2 deletions prboom2/src/p_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,10 @@ dboolean P_TryMove(mobj_t* thing,fixed_t x,fixed_t y,
*/
if (!(thing->flags & (MF_DROPOFF|MF_FLOAT)))
{
if (comp[comp_dropoff] || comp[comp_ledgeblock])
dboolean ledgeblock = comp[comp_ledgeblock] &&
!(mbf21 && thing->intflags & MIF_SCROLLING);

if (comp[comp_dropoff] || ledgeblock)
{
// e6y
// Fix demosync bug in mbf compatibility mode
Expand All @@ -1033,7 +1036,7 @@ dboolean P_TryMove(mobj_t* thing,fixed_t x,fixed_t y,
// http://www.doomworld.com/idgames/index.php?id=11138
if (
(
comp[comp_ledgeblock] ||
ledgeblock ||
!dropoff ||
(
!prboom_comp[PC_NO_DROPOFF].state &&
Expand Down
1 change: 1 addition & 0 deletions prboom2/src/p_mobj.c
Original file line number Diff line number Diff line change
Expand Up @@ -993,6 +993,7 @@ void P_MobjThinker (mobj_t* mobj)
if (mobj->momx | mobj->momy || mobj->flags & MF_SKULLFLY)
{
P_XYMovement(mobj);
mobj->intflags &= ~MIF_SCROLLING;
if (mobj->thinker.function != P_MobjThinker) // cph - Must've been removed
return; // killough - mobj was removed
}
Expand Down
1 change: 1 addition & 0 deletions prboom2/src/p_mobj.h
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@
enum {
MIF_FALLING = 1, // Object is falling
MIF_ARMED = 2, // Object is armed (for MF_TOUCHY objects)
MIF_SCROLLING = 4, // Object is affected by scroller / pusher / puller
};

// heretic
Expand Down
3 changes: 3 additions & 0 deletions prboom2/src/p_spec.c
Original file line number Diff line number Diff line change
Expand Up @@ -2938,6 +2938,7 @@ void T_Scroll(scroll_t *s)
// non-floating, and clipped.
thing->momx += dx;
thing->momy += dy;
thing->intflags |= MIF_SCROLLING;
}
break;

Expand Down Expand Up @@ -3446,6 +3447,7 @@ static dboolean PIT_PushThing(mobj_t* thing)
pushangle >>= ANGLETOFINESHIFT;
thing->momx += FixedMul(speed,finecosine[pushangle]);
thing->momy += FixedMul(speed,finesine[pushangle]);
thing->intflags |= MIF_SCROLLING;
}
}
return true;
Expand Down Expand Up @@ -3575,6 +3577,7 @@ void T_Pusher(pusher_t *p)
}
thing->momx += xspeed<<(FRACBITS-PUSH_FACTOR);
thing->momy += yspeed<<(FRACBITS-PUSH_FACTOR);
thing->intflags |= MIF_SCROLLING;
}
}

Expand Down

0 comments on commit db8c3d6

Please sign in to comment.