}
// split wishvel into wishspeed and wishdir
- wishspeed = VectorLength(wishvel);
- if (wishspeed)
- VectorScale(wishvel, 1 / wishspeed, wishdir);
- else
- VectorSet( wishdir, 0.0, 0.0, 0.0 );
+ VectorCopy(wishvel, wishdir);
+ wishspeed = VectorNormalizeLength(wishdir);
wishspeed = min(wishspeed, cl.movevars_maxspeed) * 0.7;
if (s->crouched)
VectorMAM(s->cmd.forwardmove, forward, s->cmd.sidemove, right, wishvel);
// split wishvel into wishspeed and wishdir
- wishspeed = VectorLength(wishvel);
- if (wishspeed)
- VectorScale(wishvel, 1 / wishspeed, wishdir);
- else
- VectorSet( wishdir, 0.0, 0.0, 0.0 );
+ VectorCopy(wishvel, wishdir);
+ wishspeed = VectorNormalizeLength(wishdir);
+
// check if onground
if (s->onground)
{