]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_input.c
Fixed a typo in the BSD makefile
[xonotic/darkplaces.git] / cl_input.c
index 622b601dcae301f2254389b5fd37fbb02855fb7e..3cea0ef2033a583e96bf2f04fb8a5e5d35c15f19 100644 (file)
@@ -439,6 +439,7 @@ void CL_Move (void)
 
 #include "cl_collision.h"
 
+extern void V_CalcRefdef(void);
 void CL_UpdatePrydonCursor(void)
 {
        vec3_t temp, scale;
@@ -479,11 +480,13 @@ void CL_UpdatePrydonCursor(void)
        // trace distance
        VectorScale(scale, 1000000, scale);
 
-       // FIXME: use something other than renderer variables here
-       // (but they need to match)
-       VectorCopy(r_vieworigin, cl.cmd.cursor_start);
+       // calculate current view matrix
+       V_CalcRefdef();
+       VectorClear(temp);
+       Matrix4x4_Transform(&r_refdef.viewentitymatrix, temp, cl.cmd.cursor_start);
        VectorSet(temp, cl.cmd.cursor_screen[2] * scale[2], cl.cmd.cursor_screen[0] * scale[0], cl.cmd.cursor_screen[1] * scale[1]);
-       Matrix4x4_Transform(&r_view_matrix, temp, cl.cmd.cursor_end);
+       Matrix4x4_Transform(&r_refdef.viewentitymatrix, temp, cl.cmd.cursor_end);
+       // trace from view origin to the cursor
        cl.cmd.cursor_fraction = CL_SelectTraceLine(cl.cmd.cursor_start, cl.cmd.cursor_end, cl.cmd.cursor_impact, cl.cmd.cursor_normal, &cl.cmd.cursor_entitynumber, (chase_active.integer || cl.intermission) ? &cl_entities[cl.playerentity].render : NULL);
        // makes sparks where cursor is
        //CL_SparkShower(cl.cmd.cursor_impact, cl.cmd.cursor_normal, 5, 0);
@@ -568,7 +571,7 @@ void CL_ClientMovement(qboolean buttonjump, qboolean buttoncrouch)
        // replay input queue, and remove any stale queue items
        // note: this relies on the fact there's always one queue item at the end
        // abort if client movement is disabled
-       cl.movement = cl_movement.integer && cl.stats[STAT_HEALTH] > 0 && !cls.demoplayback;
+       cl.movement = cl_movement.integer && cl.stats[STAT_HEALTH] > 0 && !cls.demoplayback && !cl.intermission;
        if (!cl.movement)
                cl.movement_numqueue = 0;
        for (i = 0;i < cl.movement_numqueue;i++)
@@ -795,6 +798,8 @@ void CL_SendMove(void)
        upmove = cl.cmd.upmove;
 #endif
 
+       CL_UpdatePrydonCursor();
+
        buf.maxsize = 128;
        buf.cursize = 0;
        buf.data = data;
@@ -950,8 +955,8 @@ void CL_SendMove(void)
        if (!buf.cursize)
                return;
 
-       // FIXME: bits & 64 is +button5, Nexuiz specific
-       CL_ClientMovement((bits & 2) != 0, (bits & 64) != 0);
+       // FIXME: bits & 16 is +button5, Nexuiz specific
+       CL_ClientMovement((bits & 2) != 0, (bits & 16) != 0);
 
        if (NetConn_SendUnreliableMessage(cls.netcon, &buf) == -1)
        {