]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - in_win.c
added in_pitch_min and in_pitch_max cvars to limit pitch (default: -90 to +90)
[xonotic/darkplaces.git] / in_win.c
index 4d5ddbe9704cd720f418307a5b8aca37ebe10992..94c343731e41555ee7385df723cd936c78e33d2a 100644 (file)
--- a/in_win.c
+++ b/in_win.c
@@ -665,13 +665,7 @@ void IN_MouseMove (usercmd_t *cmd)
        
        // LordHavoc: changed limits on pitch from -70 to 80, to -90 to 90
        if (mouselook && !(in_strafe.state & 1))
-       {
                cl.viewangles[PITCH] += m_pitch.value * mouse_y;
-               if (cl.viewangles[PITCH] > 90)
-                       cl.viewangles[PITCH] = 90;
-               if (cl.viewangles[PITCH] < -90)
-                       cl.viewangles[PITCH] = -90;
-       }
        else
        {
                if ((in_strafe.state & 1) && noclip_anglehack)
@@ -695,12 +689,13 @@ IN_Move
 */
 void IN_Move (usercmd_t *cmd)
 {
-
        if (ActiveApp && !Minimized)
        {
                IN_MouseMove (cmd);
                IN_JoyMove (cmd);
        }
+
+       cl.viewangles[PITCH] = bound (in_pitch_min.value, cl.viewangles[PITCH], in_pitch_max.value);
 }