From: havoc Date: Wed, 16 May 2007 11:47:15 +0000 (+0000) Subject: hopefully fixed a bug in line/sphere collision code (not used) X-Git-Tag: xonotic-v0.1.0preview~3164 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=841d108894c38933feef71362697ac80696bac46;p=xonotic%2Fdarkplaces.git hopefully fixed a bug in line/sphere collision code (not used) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7289 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/collision.c b/collision.c index 1e889560..7bfc9c25 100644 --- a/collision.c +++ b/collision.c @@ -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)