]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - chase.c
DOS line endings
[xonotic/darkplaces.git] / chase.c
diff --git a/chase.c b/chase.c
index 1b6e78ed2bb57337b5d653ed31938fcc49d33597..fa0f0a03f1fbc064049f709354d7a3ce77df3aa8 100644 (file)
--- a/chase.c
+++ b/chase.c
@@ -20,10 +20,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 // chase.c -- chase camera code
 
 #include "quakedef.h"
+#include "cl_collision.h"
 
-cvar_t chase_back = {CVAR_SAVE, "chase_back", "48"};
-cvar_t chase_up = {CVAR_SAVE, "chase_up", "48"};
-cvar_t chase_active = {CVAR_SAVE, "chase_active", "0"};
+cvar_t chase_back = {CVAR_SAVE, "chase_back", "48"};
+cvar_t chase_up = {CVAR_SAVE, "chase_up", "24"};
+cvar_t chase_active = {CVAR_SAVE, "chase_active", "0"};
 
 void Chase_Init (void)
 {
@@ -38,34 +39,6 @@ void Chase_Reset (void)
 //     start position 12 units behind head
 }
 
-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;
-}
-
 void Chase_Update (void)
 {
        vec3_t  forward, stop, chase_dest, normal;
@@ -81,7 +54,7 @@ void Chase_Update (void)
        chase_dest[1] = r_refdef.vieworg[1] + forward[1] * dist;
        chase_dest[2] = r_refdef.vieworg[2] + forward[2] * dist + chase_up.value;
 
-       TraceLine (r_refdef.vieworg, chase_dest, stop, normal, 0);
+       CL_TraceLine (r_refdef.vieworg, chase_dest, stop, normal, 0, true);
        chase_dest[0] = stop[0] + forward[0] * 8 + normal[0] * 4;
        chase_dest[1] = stop[1] + forward[1] * 8 + normal[1] * 4;
        chase_dest[2] = stop[2] + forward[2] * 8 + normal[2] * 4;