diff --git a/src/engine/qcommon/q_shared.h b/src/engine/qcommon/q_shared.h index e5e6a2b1f4..6eb9653a8e 100644 --- a/src/engine/qcommon/q_shared.h +++ b/src/engine/qcommon/q_shared.h @@ -693,9 +693,15 @@ inline vec_t VectorNormalize( vec3_t v ) // that length != 0, nor does it return length inline void VectorNormalizeFast( vec3_t v ) { - vec_t ilength = Q_rsqrt_fast( DotProduct( v, v ) ); + vec_t length = DotProduct( v, v ); - VectorScale( v, ilength, v ); +#if DAEMON_USE_FLOAT_EXCEPTIONS + if ( length ) +#endif + { + vec_t ilength = Q_rsqrt_fast( length ); + VectorScale( v, ilength, v ); + } } inline vec_t VectorNormalize2( const vec3_t v, vec3_t out )