From 0d4b6c8c25a155b8d5a7f6e22ab33d1f58837562 Mon Sep 17 00:00:00 2001 From: lordhavoc Date: Thu, 28 Feb 2002 07:15:41 +0000 Subject: [PATCH] fixed some majorly messed up fixes to the angle clamping git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@1593 d7cf8633-e32d-0410-b094-e92efae38249 --- cl_input.c | 6 ++++++ vid_shared.c | 3 +++ 2 files changed, 9 insertions(+) diff --git a/cl_input.c b/cl_input.c index 661b05a4..664fd1a8 100644 --- a/cl_input.c +++ b/cl_input.c @@ -281,6 +281,12 @@ void CL_AdjustAngles (void) cl.viewangles[YAW] = ANGLEMOD(cl.viewangles[YAW]); cl.viewangles[PITCH] = ANGLEMOD(cl.viewangles[PITCH]); cl.viewangles[ROLL] = ANGLEMOD(cl.viewangles[ROLL]); + if (cl.viewangles[YAW] >= 180) + cl.viewangles[YAW] -= 360; + if (cl.viewangles[PITCH] >= 180) + cl.viewangles[PITCH] -= 360; + if (cl.viewangles[ROLL] >= 180) + cl.viewangles[ROLL] -= 360; cl.viewangles[PITCH] = bound (in_pitch_min.value, cl.viewangles[PITCH], in_pitch_max.value); cl.viewangles[ROLL] = bound(-50, cl.viewangles[ROLL], 50); diff --git a/vid_shared.c b/vid_shared.c index 6730f55f..2e49b7dd 100644 --- a/vid_shared.c +++ b/vid_shared.c @@ -173,8 +173,11 @@ void IN_PreMove(void) { } +void CL_AdjustAngles(void); void IN_PostMove(void) { + // clamp after the move as well to prevent messed up rendering angles + CL_AdjustAngles(); } void IN_Mouse(usercmd_t *cmd, float mx, float my) -- 2.39.2