-int traceline_endcontents;
-
-float TraceLine (vec3_t start, vec3_t end, vec3_t impact, vec3_t normal, int contents)
-{
- trace_t trace;
-
-// FIXME: broken, fix it
-// if (impact == NULL && normal == NULL && contents == 0)
-// return SV_TestLine (cl.worldmodel->hulls, 0, start, end);
-
- Mod_CheckLoaded(cl.worldmodel);
- memset (&trace, 0, sizeof(trace));
- VectorCopy (end, trace.endpos);
- trace.fraction = 1;
- trace.startcontents = contents;
- VectorCopy(start, RecursiveHullCheckInfo.start);
- VectorSubtract(end, start, RecursiveHullCheckInfo.dist);
- RecursiveHullCheckInfo.hull = cl.worldmodel->hulls;
- RecursiveHullCheckInfo.trace = &trace;
- SV_RecursiveHullCheck (0, 0, 1, start, end);
- if (impact)
- VectorCopy (trace.endpos, impact);
- if (normal)
- VectorCopy (trace.plane.normal, normal);
- traceline_endcontents = trace.endcontents;
- return trace.fraction;
-}
-