]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_input.c
more clean up of IN_Activate, added cl_ignoremousemove to merge some code
[xonotic/darkplaces.git] / cl_input.c
index 6d138662d91942ee3452f4d4dd346cf0e640d98b..9012907d6604de4fba0d966ea824ffddcfa6b0d6 100644 (file)
@@ -319,6 +319,8 @@ void CL_AdjustAngles (void)
        cl.viewangles[ROLL] = bound(-50, cl.viewangles[ROLL], 50);
 }
 
+qboolean cl_ignoremousemove = false;
+
 /*
 ================
 CL_Move
@@ -373,6 +375,14 @@ void CL_Move (void)
        // 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_ignoremousemove)
+       {
+               cl_ignoremousemove = false;
+               in_mouse_x = 0;
+               in_mouse_y = 0;
+       }
+
        // apply m_filter if it is on
        mx = in_mouse_x;
        my = in_mouse_y;