From 640b08639e29d6e99c2e63250aefcb73e2096a66 Mon Sep 17 00:00:00 2001 From: divverent Date: Fri, 16 Jul 2010 22:24:23 +0000 Subject: [PATCH] Some comments and a view bound on the speed, which should match xyspeed's for the bobbing From: MirceaKitsune git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10338 d7cf8633-e32d-0410-b094-e92efae38249 --- view.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/view.c b/view.c index 78d9013b..81a448fe 100644 --- a/view.c +++ b/view.c @@ -717,14 +717,15 @@ void V_CalcRefdef (void) // TEST!!! float ground_hit_target; + // get the speed while in the air, apply it while we're not if (!cl.onground) - cl.ground_hit_speed = cl.velocity[2] * 0.1; + cl.ground_hit_speed = bound(0, cl.velocity[2] * 0.1, 400); // replace 0.1 with cvar else { if(cl.ground_hit_speed > ground_hit_target) - cl.ground_hit_speed -= 0.1; + cl.ground_hit_speed -= 0.1; // replace 0.1 with cvar if(cl.ground_hit_speed < ground_hit_target) - cl.ground_hit_speed += 0.1; + cl.ground_hit_speed += 0.1; // replace 0.1 with cvar vieworg[2] += cl.ground_hit_speed; gunorg[2] += cl.ground_hit_speed; -- 2.39.2