- num = node->children[0];
- goto loc0;
- }
- if (t1 < 0 && t2 < 0)
- {
- num = node->children[1];
- goto loc0;
- }
-
-// put the crosspoint DIST_EPSILON pixels on the near side
- side = (t1 < 0);
- if (side)
- frac = bound(0, (t1 + DIST_EPSILON) / (t1 - t2), 1);
- else
- frac = bound(0, (t1 - DIST_EPSILON) / (t1 - t2), 1);
-
- midf = p1f + (p2f - p1f)*frac;
- for (i=0 ; i<3 ; i++)
- mid[i] = p1[i] + frac*(p2[i] - p1[i]);
-
-// move up to the node
- if (!SV_RecursiveHullCheck (hull, node->children[side], p1f, midf, p1, mid, trace) )
- return false;
-
-#ifdef PARANOID
- if (SV_HullPointContents (pm_hullmodel, mid, node->children[side]) == CONTENTS_SOLID)
- {
- Con_Printf ("mid PointInHullSolid\n");
- return false;
- }
-#endif
-
- // LordHavoc: warning to the clumsy, this recursion can not be optimized because mid would need to be duplicated on a stack
- if (SV_HullPointContents (hull, node->children[side^1], mid) != CONTENTS_SOLID)
-// go past the node
- return SV_RecursiveHullCheck (hull, node->children[side^1], midf, p2f, mid, p2, trace);
-
- if (trace->allsolid)
- return false; // never got out of the solid area
-
-//==================
-// the other side of the node is solid, this is the impact point
-//==================
- if (!side)
- {
- VectorCopy (plane->normal, trace->plane.normal);
- trace->plane.dist = plane->dist;