Check maxstep is not disabled before stepping up

Fixes infinite step up when it should be no step up.
This commit is contained in:
James R 2020-10-26 14:00:54 -07:00
parent 713b965a85
commit 18a2e87093

View file

@ -2735,7 +2735,7 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
// Step up // Step up
if (thing->z < tmfloorz) if (thing->z < tmfloorz)
{ {
if (tmfloorz - thing->z <= maxstep) if (maxstep > 0 && tmfloorz - thing->z <= maxstep)
{ {
thing->z = thing->floorz = tmfloorz; thing->z = thing->floorz = tmfloorz;
thing->floorrover = tmfloorrover; thing->floorrover = tmfloorrover;
@ -2748,7 +2748,7 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
} }
else if (tmceilingz < thingtop) else if (tmceilingz < thingtop)
{ {
if (thingtop - tmceilingz <= maxstep) if (maxstep > 0 && thingtop - tmceilingz <= maxstep)
{ {
thing->z = ( thing->ceilingz = tmceilingz ) - thing->height; thing->z = ( thing->ceilingz = tmceilingz ) - thing->height;
thing->ceilingrover = tmceilingrover; thing->ceilingrover = tmceilingrover;