]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_input.c
damn, THIS fix wasn't need - the demo reading fix already did that
[xonotic/darkplaces.git] / cl_input.c
index 0b9176f6ba78bfcc7152f8b89307c9f1ff214ef7..57de662cca70b4ca7b3319a9d385852bd59f7a7d 100644 (file)
@@ -489,8 +489,11 @@ void CL_AdjustAngles (void)
                V_StopPitchDrift ();
 
        cl.viewangles[YAW] = ANGLEMOD(cl.viewangles[YAW]);
+       cl.viewangles[PITCH] = ANGLEMOD(cl.viewangles[PITCH]);
        if (cl.viewangles[YAW] >= 180)
                cl.viewangles[YAW] -= 360;
+       if (cl.viewangles[PITCH] >= 180)
+               cl.viewangles[PITCH] -= 360;
        cl.viewangles[PITCH] = bound(in_pitch_min.value, cl.viewangles[PITCH], in_pitch_max.value);
        cl.viewangles[ROLL] = bound(-180, cl.viewangles[ROLL], 180);
 }
@@ -547,20 +550,9 @@ void CL_Input (void)
                cl.cmd.upmove *= cl_movespeedkey.value;
        }
 
-       in_mouse_x = 0;
-       in_mouse_y = 0;
-
        // allow mice or other external controllers to add to the move
        IN_Move ();
 
-       // ignore a mouse move if mouse was activated/deactivated this frame
-       if (cl_ignoremousemoves)
-       {
-               cl_ignoremousemoves--;
-               in_mouse_x = 0;
-               in_mouse_y = 0;
-       }
-
        // apply m_filter if it is on
        mx = in_mouse_x;
        my = in_mouse_y;
@@ -572,8 +564,16 @@ void CL_Input (void)
        old_mouse_x = mx;
        old_mouse_y = my;
 
+       // ignore a mouse move if mouse was activated/deactivated this frame
+       if (cl_ignoremousemoves)
+       {
+               cl_ignoremousemoves--;
+               in_mouse_x = old_mouse_x = 0;
+               in_mouse_y = old_mouse_y = 0;
+       }
+
        // if not in menu, apply mouse move to viewangles/movement
-       if (!cl.csqc_wantsmousemove && in_client_mouse)
+       if (!key_consoleactive && key_dest == key_game && !cl.csqc_wantsmousemove)
        {
                float modulatedsensitivity = sensitivity.value * cl.sensitivityscale;
                if (cl_prydoncursor.integer)
@@ -610,6 +610,8 @@ void CL_Input (void)
                        cl.cmd.forwardmove -= m_forward.value * in_mouse_y * modulatedsensitivity;
                }
        }
+       else // don't pitch drift when csqc is controlling the mouse
+               V_StopPitchDrift();
 
        if(v_flipped.integer)
        {
@@ -930,7 +932,7 @@ void CL_ClientMovement_Physics_Swim(cl_clientmovement_state_t *s)
        if (s->waterjumptime <= 0)
        {
                // water friction
-               f = 1 - s->cmd.frametime * cl.movevars_waterfriction * s->waterlevel;
+               f = 1 - s->cmd.frametime * cl.movevars_waterfriction * (cls.protocol == PROTOCOL_QUAKEWORLD ? s->waterlevel : 1);
                f = bound(0, f, 1);
                VectorScale(s->velocity, f, s->velocity);
 
@@ -1411,7 +1413,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)