]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
hopefully fixed a bug in line/sphere collision code (not used)
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 16 May 2007 11:47:15 +0000 (11:47 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 16 May 2007 11:47:15 +0000 (11:47 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7289 d7cf8633-e32d-0410-b094-e92efae38249

collision.c

index 1e8895606a939c9f79dbbba3028f4ce4c83d3e01..7bfc9c25d0168d9fc4f3a07f93f7b8ae53314c0b 100644 (file)
@@ -1145,7 +1145,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 += deviationdist - sphereradius;
+       impactdist -= sphereradius - deviationdist/sphereradius;
        if (impactdist >= linelength)
                return 1; // miss (not close enough)
        if (impactdist < 0)