From f10f49777267ac15108f2df78cc555583856f136 Mon Sep 17 00:00:00 2001 From: divverent Date: Fri, 16 Jul 2010 22:24:17 +0000 Subject: [PATCH] Make the view slowly go back after hitting the ground. We need to do the same for both up and down. Also use reasonable values until cvars are done. From: MirceaKitsune git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10337 d7cf8633-e32d-0410-b094-e92efae38249 --- view.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/view.c b/view.c index 0bcf9b55..78d9013b 100644 --- a/view.c +++ b/view.c @@ -716,10 +716,19 @@ void V_CalcRefdef (void) // TEST!!! + float ground_hit_target; if (!cl.onground) - cl.ground_hit_speed = cl.velocity[2]; + cl.ground_hit_speed = cl.velocity[2] * 0.1; else + { + if(cl.ground_hit_speed > ground_hit_target) + cl.ground_hit_speed -= 0.1; + if(cl.ground_hit_speed < ground_hit_target) + cl.ground_hit_speed += 0.1; + vieworg[2] += cl.ground_hit_speed; + gunorg[2] += cl.ground_hit_speed; + } // End of TEST!!! -- 2.39.2