]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - view.c
added cl.movement_velocity to allow view bobbing to match up with cl_movement
[xonotic/darkplaces.git] / view.c
diff --git a/view.c b/view.c
index b1e2a98df4927b83ca338ab9a23c4a23ae427c8b..7b1ca6ddb1acb46da513add316c8d54e2e46ca72 100644 (file)
--- a/view.c
+++ b/view.c
@@ -388,7 +388,7 @@ void V_CalcRefdef (void)
                                if (cl.stats[STAT_HEALTH] <= 0 && gamemode != GAME_FNIGGIUM)
                                        viewangles[ROLL] = 80;  // dead view angle
                                VectorAdd(viewangles, cl.punchangle, viewangles);
-                               viewangles[ROLL] += V_CalcRoll(cl.viewangles, cl.velocity);
+                               viewangles[ROLL] += V_CalcRoll(cl.viewangles, cl.movement_velocity);
                                if (v_dmg_time > 0)
                                {
                                        viewangles[ROLL] += v_dmg_time/v_kicktime.value*v_dmg_roll;
@@ -413,7 +413,7 @@ void V_CalcRefdef (void)
                                                cycle = sin(M_PI + M_PI * (cycle-cl_bobup.value)/(1.0 - cl_bobup.value));
                                        // bob is proportional to velocity in the xy plane
                                        // (don't count Z, or jumping messes it up)
-                                       bob = sqrt(cl.velocity[0]*cl.velocity[0] + cl.velocity[1]*cl.velocity[1]) * cl_bob.value;
+                                       bob = sqrt(cl.movement_velocity[0]*cl.movement_velocity[0] + cl.movement_velocity[1]*cl.movement_velocity[1]) * cl_bob.value;
                                        bob = bob*0.3 + bob*0.7*cycle;
                                        vieworg[2] += bound(-7, bob, 4);
                                }