From a038c55b7cf69f173993a4301c653efc017657d8 Mon Sep 17 00:00:00 2001 From: havoc Date: Fri, 7 Oct 2005 12:56:54 +0000 Subject: [PATCH] fix a stupid bug in line/sphere collision code (was using sqrt where it shouldn't) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5731 d7cf8633-e32d-0410-b094-e92efae38249 --- collision.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/collision.c b/collision.c index 30f4d766..4dc31a9d 100644 --- a/collision.c +++ b/collision.c @@ -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) -- 2.39.2