From b1ad773292431e6221b366ab72bc03ce70f152bb Mon Sep 17 00:00:00 2001 From: Spoike Date: Wed, 15 Dec 2004 19:48:47 +0000 Subject: [PATCH] This might be a small speedup. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@651 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/common/gl_q2bsp.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/engine/common/gl_q2bsp.c b/engine/common/gl_q2bsp.c index d652fc2c5..19773cc2b 100644 --- a/engine/common/gl_q2bsp.c +++ b/engine/common/gl_q2bsp.c @@ -4606,9 +4606,16 @@ trace_t CM_TransformedBoxTrace (vec3_t start, vec3_t end, trace.plane.normal[2] = DotProduct (temp, up); } - trace.endpos[0] = start[0] + trace.fraction * (end[0] - start[0]); - trace.endpos[1] = start[1] + trace.fraction * (end[1] - start[1]); - trace.endpos[2] = start[2] + trace.fraction * (end[2] - start[2]); + if (trace.fraction == 1) + { + VectorCopy(end, trace.endpos); + } + else + { + trace.endpos[0] = start[0] + trace.fraction * (end[0] - start[0]); + trace.endpos[1] = start[1] + trace.fraction * (end[1] - start[1]); + trace.endpos[2] = start[2] + trace.fraction * (end[2] - start[2]); + } return trace; }