From: havoc Date: Fri, 10 Mar 2006 02:31:42 +0000 (+0000) Subject: fixed bullets-going-through-walls bug in q3bsp collision code, this was a really... X-Git-Tag: xonotic-v0.1.0preview~4232 X-Git-Url: http://de.git.xonotic.org/?a=commitdiff_plain;h=472197398fe654ff163fd52dccb00b35dafae79c;p=xonotic%2Fdarkplaces.git fixed bullets-going-through-walls bug in q3bsp collision code, this was a really nasty bug in the midfrac calculations (it was calculating the midfrac for the partially clipped line segment and then acting as if that was a fraction of the complete line segment... this caused many problems) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6084 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/model_brush.c b/model_brush.c index 8ba4db8e..9704cccd 100644 --- a/model_brush.c +++ b/model_brush.c @@ -5070,8 +5070,10 @@ static void Mod_Q3BSP_TraceLine_RecursiveBSPNode(trace_t *trace, model_t *model, else { // line crosses node plane, split the line + dist1 = PlaneDiff(linestart, node->plane); + dist2 = PlaneDiff(lineend, node->plane); midfrac = dist1 / (dist1 - dist2); - VectorLerp(start, midfrac, end, mid); + VectorLerp(linestart, midfrac, lineend, mid); // take the near side first Mod_Q3BSP_TraceLine_RecursiveBSPNode(trace, model, node->children[startside], start, mid, startfrac, midfrac, linestart, lineend, markframe, segmentmins, segmentmaxs); if (midfrac <= trace->realfraction)