]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_collision.c
now supports Mac and Windows newlines everywhere
[xonotic/darkplaces.git] / cl_collision.c
index c0725fa08c4c7c21b8b554e6bc15b4156696cc04..ef7bce39d1e579757e3be07f2f56a2a3ec809d3a 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;
@@ -168,7 +170,9 @@ float CL_SelectTraceLine(const vec3_t start, const vec3_t end, vec3_t impact, ve
                        }
                }
        }
-       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;