]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Some comments and a view bound on the speed, which should match xyspeed's for the...
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 16 Jul 2010 22:24:23 +0000 (22:24 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 16 Jul 2010 22:24:23 +0000 (22:24 +0000)
From: MirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>

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

view.c

diff --git a/view.c b/view.c
index 78d9013b4abbdedad548d83d6544edd6ef2aa67e..81a448fe94cad7e9562285e9c0a4d92b2b1c5646 100644 (file)
--- 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;