From: havoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Date: Thu, 13 Jan 2005 06:11:38 +0000 (+0000)
Subject: bound the fractions in CL_TraceLine instead of posting a warning, as out of bounds... 
X-Git-Tag: xonotic-v0.1.0preview~5231
X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=4147f4e4f3341da88dfbe4df2c5bdab97e8cd08c;p=xonotic%2Fdarkplaces.git

bound the fractions in CL_TraceLine instead of posting a warning, as out of bounds fractions have no harmful effects during a trace (to allow the bounds in the trace code to be removed)


git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4918 d7cf8633-e32d-0410-b094-e92efae38249
---

diff --git a/cl_collision.c b/cl_collision.c
index c0725fa0..5e59158f 100644
--- a/cl_collision.c
+++ b/cl_collision.c
@@ -96,7 +96,9 @@ float CL_TraceLine(const vec3_t start, const vec3_t end, vec3_t impact, vec3_t n
 			}
 		}
 	}
-	if (maxfrac < 0 || maxfrac > 1) Con_Printf("fraction out of bounds %f %s:%d\n", maxfrac, __FILE__, __LINE__);
+	maxfrac = bound(0, maxfrac, 1);
+	maxrealfrac = bound(0, maxrealfrac, 1);
+	//if (maxfrac < 0 || maxfrac > 1) Con_Printf("fraction out of bounds %f %s:%d\n", maxfrac, __FILE__, __LINE__);
 	if (impact)
 		VectorLerp(start, maxfrac, end, impact);
 	return maxfrac;