]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
patch from Blub\0 which adds back the wrapping behavior on pitch when
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 30 Mar 2008 10:17:16 +0000 (10:17 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 30 Mar 2008 10:17:16 +0000 (10:17 +0000)
in_pitch_min/max are set to very large values (this basically lets you
aim up or down so much that you wrap to the other direction)

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8236 d7cf8633-e32d-0410-b094-e92efae38249

cl_input.c

index 711f57e97cddb095f347f72a6233d24dce388743..c1430ec40890c23428202ec7336ebc3b559cf2eb 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);
 }