Restore stair step smoothing code for step sizes != 16

commit 93e9633382 "Port step smoothing code from r1q2." ported
r1q2 stair step smoothing for ranges that are equivalent to 8, 12 and 16
units/step.
Later in commit 7f996cc "Don't smooth half height steps" we removed
step sizes 8 and 12, because it appeared to make an elevator in hangar2
(over the water, after jump'n'run sequency) stutter.
However, in reality what made them stutter was the broken comparison
for velocity with an illegal cast, that we later fixed in
e30f82494 "Don't cast the array itself but it's content."

So now restore the smoothing for step sizes 8 and 12, which hopefully
fixes bug #923, and definitely does *not* break the elevater in hangar2.
This commit is contained in:
Daniel Gibson 2022-10-22 17:09:17 +02:00
parent 898b87f0f4
commit 690e46512e

View file

@ -292,10 +292,12 @@ CL_PredictMovement(void)
VectorCopy(pm.s.origin, cl.predicted_origins[frame]);
}
// step is used for movement prediction on stairs
// (so moving up/down stairs is smooth)
step = pm.s.origin[2] - (int)(cl.predicted_origin[2] * 8);
VectorCopy(pm.s.velocity, tmp);
if (((step > 126 && step < 130))
if (((step > 62 && step < 66) || (step > 94 && step < 98) || (step > 126 && step < 130))
&& !VectorCompare(tmp, vec3_origin)
&& (pm.s.pm_flags & PMF_ON_GROUND))
{