]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
fix a stupid bug in line/sphere collision code (was using sqrt where it shouldn't)
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 7 Oct 2005 12:56:54 +0000 (12:56 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 7 Oct 2005 12:56:54 +0000 (12:56 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5731 d7cf8633-e32d-0410-b094-e92efae38249

collision.c

index 30f4d7662acdae19488a51c9d22811a30c4c901f..4dc31a9d2b609b845471f1043531ff2b61ea90c5 100644 (file)
@@ -1097,7 +1097,7 @@ float Collision_ClipTrace_Line_Sphere(double *linestart, double *lineend, double
        if (deviationdist > sphereradius*sphereradius)
                return 1; // miss (off to the side)
        // nudge back to find the correct impact distance
-       impactdist += (sqrt(deviationdist) - sphereradius);
+       impactdist += deviationdist - sphereradius;
        if (impactdist >= linelength)
                return 1; // miss (not close enough)
        if (impactdist < 0)