Don't cast the array itself but it's content.

This was so broken... Casting the type of an array to silence a
warning... It worked on x86, of course. But gave a SIGBUS on ARM.
Do it right, cast / copy the content of the array into another
array of the correct type. Yeah.

This fixes issue #231.
This commit is contained in:
Yamagi Burmeister 2017-11-14 17:24:41 +00:00
parent 82616d0992
commit e30f824944

View file

@ -231,6 +231,7 @@ CL_PredictMovement(void)
pmove_t pm;
int i;
int step;
vec3_t tmp;
if (cls.state != ca_active)
{
@ -296,9 +297,10 @@ CL_PredictMovement(void)
}
step = pm.s.origin[2] - (int)(cl.predicted_origin[2] * 8);
VectorCopy(tmp, pm.s.velocity);
if (((step > 126 && step < 130))
&& !VectorCompare((float *)pm.s.velocity, vec3_origin)
&& !VectorCompare(tmp, vec3_origin)
&& (pm.s.pm_flags & PMF_ON_GROUND))
{
cl.predicted_step = step * 0.125f;