]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_collision.c
bound the fractions in CL_TraceLine instead of posting a warning, as out of bounds...
[xonotic/darkplaces.git] / 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;
        if (impact)
                VectorLerp(start, maxfrac, end, impact);
        return maxfrac;