From 9967420c64a7fd3e420ac417f310cbe189c00738 Mon Sep 17 00:00:00 2001 From: divverent Date: Sun, 2 May 2010 14:04:22 +0000 Subject: [PATCH] TODO 2 done. View model rotation is now limited. Will do the cvars tomorrow. From: MirceaKitsune git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10126 d7cf8633-e32d-0410-b094-e92efae38249 --- view.c | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/view.c b/view.c index 7a21c01d..87da5544 100644 --- a/view.c +++ b/view.c @@ -602,14 +602,34 @@ void V_CalcRefdef (void) viewmodel_push_x -= 360; if(viewmodel_push_x < cl.viewangles[PITCH]) - viewmodel_push_x += (cl.viewangles[PITCH] - viewmodel_push_x) * 0.01; - else if(viewmodel_push_x > cl.viewangles[PITCH]) - viewmodel_push_x -= (viewmodel_push_x - cl.viewangles[PITCH]) * 0.01; + { + if(cl.viewangles[PITCH] - viewmodel_push_x > 15) + viewmodel_push_x = cl.viewangles[PITCH] - 15; + else + viewmodel_push_x += (cl.viewangles[PITCH] - viewmodel_push_x) * 0.01; + } + if(viewmodel_push_x > cl.viewangles[PITCH]) + { + if(viewmodel_push_x - cl.viewangles[PITCH] > 15) + viewmodel_push_x = cl.viewangles[PITCH] + 15; + else + viewmodel_push_x -= (viewmodel_push_x - cl.viewangles[PITCH]) * 0.01; + } if(viewmodel_push_y < cl.viewangles[YAW]) - viewmodel_push_y += (cl.viewangles[YAW] - viewmodel_push_y) * 0.01; - else if(viewmodel_push_y > cl.viewangles[YAW]) - viewmodel_push_y -= (viewmodel_push_y - cl.viewangles[YAW]) * 0.01; + { + if(cl.viewangles[YAW] - viewmodel_push_y > 15) + viewmodel_push_y = cl.viewangles[YAW] - 15; + else + viewmodel_push_y += (cl.viewangles[YAW] - viewmodel_push_y) * 0.01; + } + if(viewmodel_push_y > cl.viewangles[YAW]) + { + if(viewmodel_push_y - cl.viewangles[YAW] > 15) + viewmodel_push_y = cl.viewangles[YAW] + 15; + else + viewmodel_push_y -= (viewmodel_push_y - cl.viewangles[YAW]) * 0.01; + } VectorSet(gunangles, viewmodel_push_x, viewmodel_push_y, viewangles[2]); } -- 2.39.2