]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_input.c
redesigned csqc shared entity .Version handling, now internally uses a
[xonotic/darkplaces.git] / cl_input.c
index be24b9a1f6632cf806695d5becfa106d4ec4f423..b33a96032fc1ccabfe6c358118337a3f9caf946d 100644 (file)
@@ -621,9 +621,6 @@ void CL_Input (void)
 
        // clamp after the move to prevent rendering with bad angles
        CL_AdjustAngles ();
-
-       in_mouse_x = 0;
-       in_mouse_y = 0;
 }
 
 #include "cl_collision.h"
@@ -1016,27 +1013,30 @@ void CL_ClientMovement_Physics_Walk(cl_clientmovement_state_t *s)
        {
                // apply edge friction
                f = sqrt(s->velocity[0] * s->velocity[0] + s->velocity[1] * s->velocity[1]);
-               friction = cl.movevars_friction;
-               if (f > 0 && cl.movevars_edgefriction != 1)
+               if (f > 0)
                {
-                       vec3_t neworigin2;
-                       vec3_t neworigin3;
-                       // note: QW uses the full player box for the trace, and yet still
-                       // uses s->origin[2] + s->mins[2], which is clearly an bug, but
-                       // this mimics it for compatibility
-                       VectorSet(neworigin2, s->origin[0] + s->velocity[0]*(16/f), s->origin[1] + s->velocity[1]*(16/f), s->origin[2] + s->mins[2]);
-                       VectorSet(neworigin3, neworigin2[0], neworigin2[1], neworigin2[2] - 34);
-                       if (cls.protocol == PROTOCOL_QUAKEWORLD)
-                               trace = CL_Move(neworigin2, s->mins, s->maxs, neworigin3, MOVE_NORMAL, NULL, SUPERCONTENTS_SOLID | SUPERCONTENTS_BODY | SUPERCONTENTS_PLAYERCLIP, true, true, NULL, false);
-                       else
-                               trace = CL_Move(neworigin2, vec3_origin, vec3_origin, neworigin3, MOVE_NORMAL, NULL, SUPERCONTENTS_SOLID | SUPERCONTENTS_BODY | SUPERCONTENTS_PLAYERCLIP, true, true, NULL, false);
-                       if (trace.fraction == 1 && !trace.startsolid)
-                               friction *= cl.movevars_edgefriction;
+                       friction = cl.movevars_friction;
+                       if (cl.movevars_edgefriction != 1)
+                       {
+                               vec3_t neworigin2;
+                               vec3_t neworigin3;
+                               // note: QW uses the full player box for the trace, and yet still
+                               // uses s->origin[2] + s->mins[2], which is clearly an bug, but
+                               // this mimics it for compatibility
+                               VectorSet(neworigin2, s->origin[0] + s->velocity[0]*(16/f), s->origin[1] + s->velocity[1]*(16/f), s->origin[2] + s->mins[2]);
+                               VectorSet(neworigin3, neworigin2[0], neworigin2[1], neworigin2[2] - 34);
+                               if (cls.protocol == PROTOCOL_QUAKEWORLD)
+                                       trace = CL_Move(neworigin2, s->mins, s->maxs, neworigin3, MOVE_NORMAL, NULL, SUPERCONTENTS_SOLID | SUPERCONTENTS_BODY | SUPERCONTENTS_PLAYERCLIP, true, true, NULL, false);
+                               else
+                                       trace = CL_Move(neworigin2, vec3_origin, vec3_origin, neworigin3, MOVE_NORMAL, NULL, SUPERCONTENTS_SOLID | SUPERCONTENTS_BODY | SUPERCONTENTS_PLAYERCLIP, true, true, NULL, false);
+                               if (trace.fraction == 1 && !trace.startsolid)
+                                       friction *= cl.movevars_edgefriction;
+                       }
+                       // apply ground friction
+                       f = 1 - s->cmd.frametime * friction * ((f < cl.movevars_stopspeed) ? (cl.movevars_stopspeed / f) : 1);
+                       f = max(f, 0);
+                       VectorScale(s->velocity, f, s->velocity);
                }
-               // apply ground friction
-               f = 1 - s->cmd.frametime * friction * ((f < cl.movevars_stopspeed) ? (cl.movevars_stopspeed / f) : 1);
-               f = max(f, 0);
-               VectorScale(s->velocity, f, s->velocity);
                addspeed = wishspeed - DotProduct(s->velocity, wishdir);
                if (addspeed > 0)
                {
@@ -1416,7 +1416,7 @@ void CL_SendMove(void)
                packettime = 0;
        // always send if buttons changed or an impulse is pending
        // even if it violates the rate limit!
-       if (!cl_netimmediatebuttons.integer || (cl.movecmd[0].buttons == cl.movecmd[1].buttons && !cl.movecmd[0].impulse))
+       if (!cl.movecmd[0].impulse && (!cl_netimmediatebuttons.integer || cl.movecmd[0].buttons == cl.movecmd[1].buttons))
        {
                // don't choke the connection with packets (obey rate limit)
                if ((cls.protocol == PROTOCOL_QUAKEWORLD || cls.signon == SIGNONS) && !NetConn_CanSend(cls.netcon) && !cl.islocalgame)