]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
bound the fractions in CL_TraceLine instead of posting a warning, as out of bounds...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 13 Jan 2005 06:11:38 +0000 (06:11 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 13 Jan 2005 06:11:38 +0000 (06:11 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4918 d7cf8633-e32d-0410-b094-e92efae38249

cl_collision.c

index c0725fa08c4c7c21b8b554e6bc15b4156696cc04..5e59158fa4a3dc03b207f54bbe0354c633ad3461 100644 (file)
@@ -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;