From: black Date: Sun, 12 Jun 2005 16:34:03 +0000 (+0000) Subject: Fixed a VC runtime assertion caused by wishdir not being initialized when wishspeed... X-Git-Tag: xonotic-v0.1.0preview~4754 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=9d4ddf105ffd42ee018373c54d9679594904c670;p=xonotic%2Fdarkplaces.git Fixed a VC runtime assertion caused by wishdir not being initialized when wishspeed equals zero. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5428 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/cl_input.c b/cl_input.c index 03421328..b24d8ea1 100644 --- a/cl_input.c +++ b/cl_input.c @@ -632,6 +632,8 @@ void CL_ClientMovement_Replay(void) wishspeed = VectorLength(wishvel); if (wishspeed) VectorScale(wishvel, 1 / wishspeed, wishdir); + else + VectorSet( wishdir, 0.0, 0.0, 0.0 ); wishspeed = min(wishspeed, cl_movement_maxspeed.value); if (crouch) wishspeed *= 0.5; @@ -672,6 +674,8 @@ void CL_ClientMovement_Replay(void) wishspeed = VectorLength(wishvel); if (wishspeed) VectorScale(wishvel, 1 / wishspeed, wishdir); + else + VectorSet( wishdir, 0.0, 0.0, 0.0 ); wishspeed = min(wishspeed, cl_movement_maxspeed.value); if (crouch) wishspeed *= 0.5;