]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
add an error check for invalid maxfrac before returning it, nothing significant
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 27 Oct 2002 12:00:37 +0000 (12:00 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 27 Oct 2002 12:00:37 +0000 (12:00 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@2566 d7cf8633-e32d-0410-b094-e92efae38249

cl_collision.c

index 0af6d38bd7b52de1ac8ac9a990994d5702250e83..8269bebbf22dbedddec4c5aef1952f39976507ea 100644 (file)
@@ -1,5 +1,6 @@
 
 #include "quakedef.h"
+#include "cl_collision.h"
 
 /*
 // not yet used
@@ -32,7 +33,10 @@ int cl_traceline_endcontents;
 
 float CL_TraceLine (const vec3_t start, const vec3_t end, vec3_t impact, vec3_t normal, int contents, int hitbmodels, entity_render_t **hitent)
 {
-       double maxfrac;
+       float maxfrac;
+       int n;
+       entity_render_t *ent;
+       float tracemins[3], tracemaxs[3];
        trace_t trace;
 
        if (hitent)
@@ -51,9 +55,6 @@ float CL_TraceLine (const vec3_t start, const vec3_t end, vec3_t impact, vec3_t
 
        if (hitbmodels && cl_num_brushmodel_entities)
        {
-               int n;
-               entity_render_t *ent;
-               double tracemins[3], tracemaxs[3];
                tracemins[0] = min(start[0], end[0]);
                tracemaxs[0] = max(start[0], end[0]);
                tracemins[1] = min(start[1], end[1]);
@@ -85,6 +86,7 @@ float CL_TraceLine (const vec3_t start, const vec3_t end, vec3_t impact, vec3_t
                        }
                }
        }
+       if (maxfrac < 0 || maxfrac > 1) Con_Printf("fraction out of bounds %f %s:%d\n", maxfrac, __LINE__, __FILE__);
        return maxfrac;
 }