Increase step up with water-running just like water-skipping

This commit is contained in:
James R 2021-12-07 16:26:52 -08:00
parent ce366099b0
commit f2e8d7d469

View file

@ -2414,6 +2414,20 @@ boolean PIT_PushableMoved(mobj_t *thing)
return true;
}
static boolean P_WaterRunning(mobj_t *thing)
{
ffloor_t *rover = thing->floorrover;
return rover && (rover->flags & FF_SWIMMABLE) &&
P_IsObjectOnGround(thing);
}
static boolean P_WaterStepUp(mobj_t *thing)
{
player_t *player = thing->player;
return (player && player->waterskip) ||
P_WaterRunning(thing);
}
//
// P_TryMove
// Attempt to move to a new position.
@ -2478,7 +2492,7 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
const fixed_t maxstepmove = FixedMul(MAXSTEPMOVE, mapobjectscale);
fixed_t maxstep = maxstepmove;
if (thing->player && thing->player->waterskip)
if (thing->player && P_WaterStepUp(thing))
maxstep += maxstepmove; // Add some extra stepmove when waterskipping
// If using type Section1:13, double the maxstep.