]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
TODO 2 done. View model rotation is now limited. Will do the cvars tomorrow.
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 2 May 2010 14:04:22 +0000 (14:04 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 2 May 2010 14:04:22 +0000 (14:04 +0000)
From: MirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>

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

view.c

diff --git a/view.c b/view.c
index 7a21c01dde9f1bf4349e61fadc26e3030ee053ec..87da55443f344563f86de604261f2f1bfe107d07 100644 (file)
--- 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]);
                                }