]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - in_svgalib.c
added in_pitch_min and in_pitch_max cvars to limit pitch (default: -90 to +90)
[xonotic/darkplaces.git] / in_svgalib.c
index c84c6d65fc872715869933098f35456b8b15b13d..bf31dbe12e28c571b8a52d4d8e9721ed1c663b2f 100644 (file)
@@ -368,13 +368,7 @@ void IN_Move(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)
@@ -382,6 +376,7 @@ void IN_Move(usercmd_t *cmd)
                else
                        cmd->forwardmove -= m_forward.value * mouse_y;
        }
+       cl.viewangles[PITCH] = bound (in_pitch_min.value, cl.viewangles[PITCH], in_pitch_max.value);
 }
 
 void IN_HandlePause (qboolean pause)