]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - collision.c
water moves around again
[xonotic/darkplaces.git] / collision.c
index de405720a73ee0a1cf891862159b490ea9660274..7ed1291eaf18c06a3ecce7840bd6c11529c0716c 100644 (file)
@@ -376,10 +376,11 @@ void Collision_ClipTrace (trace_t *trace, const void *cent, const model_t *cmode
                VectorCopy(endd, rhc.end);
                VectorCopy(rhc.end, rhc.trace->endpos);
                VectorSubtract(rhc.end, rhc.start, rhc.dist);
-               if (DotProduct(rhc.dist, rhc.dist) > 0.00001)
+               if (rhc.dist[0] || rhc.dist[1] || rhc.dist[2])
                        RecursiveHullCheck (&rhc, rhc.hull->firstclipnode, 0, 1, rhc.start, rhc.end);
                else
                        RecursiveHullCheckPoint (&rhc, rhc.hull->firstclipnode);
+               if (rhc.trace->fraction < 0 || rhc.trace->fraction > 1) Con_Printf("fraction out of bounds %f %s:%d\n", rhc.trace->fraction, __LINE__, __FILE__);
 
                // if we hit, unrotate endpos and normal, and store the entity we hit
                if (rhc.trace->fraction != 1)
@@ -418,10 +419,11 @@ void Collision_ClipTrace (trace_t *trace, const void *cent, const model_t *cmode
                VectorSubtract(end, offset, rhc.end);
                VectorCopy(rhc.end, rhc.trace->endpos);
                VectorSubtract(rhc.end, rhc.start, rhc.dist);
-               if (DotProduct(rhc.dist, rhc.dist) > 0.00001)
+               if (rhc.dist[0] || rhc.dist[1] || rhc.dist[2])
                        RecursiveHullCheck (&rhc, rhc.hull->firstclipnode, 0, 1, rhc.start, rhc.end);
                else
                        RecursiveHullCheckPoint (&rhc, rhc.hull->firstclipnode);
+               if (rhc.trace->fraction < 0 || rhc.trace->fraction > 1) Con_Printf("fraction out of bounds %f %s:%d\n", rhc.trace->fraction, __LINE__, __FILE__);
 
                // if we hit, store the entity we hit
                if (rhc.trace->fraction != 1)