From b801f2e6336a273e2fede59039bc393185a6f061 Mon Sep 17 00:00:00 2001 From: divverent Date: Sun, 2 May 2010 14:05:27 +0000 Subject: [PATCH] Limits for part 2. From: MirceaKitsune git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10132 d7cf8633-e32d-0410-b094-e92efae38249 --- view.c | 42 ++++++++++++++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/view.c b/view.c index 4172d096..39c4be9c 100644 --- a/view.c +++ b/view.c @@ -655,19 +655,49 @@ void V_CalcRefdef (void) // gun model following code if(gunorg_follow[0] < vieworg[0]) - gunorg_follow[0] += (vieworg[0] - gunorg_follow[0]) * 5 * ef_speed; + { + if(vieworg[0] - gunorg_follow[0] > 5) + gunorg_follow[0] = vieworg[0] - 5; + else + gunorg_follow[0] += (vieworg[0] - gunorg_follow[0]) * 5 * ef_speed; + } if(gunorg_follow[0] > vieworg[0]) - gunorg_follow[0] -= (gunorg_follow[0] - vieworg[0]) * 5 * ef_speed; + { + if(gunorg_follow[0] - vieworg[0] > 5) + gunorg_follow[0] = vieworg[0] + 5; + else + gunorg_follow[0] -= (gunorg_follow[0] - vieworg[0]) * 5 * ef_speed; + } if(gunorg_follow[1] < vieworg[1]) - gunorg_follow[1] += (vieworg[1] - gunorg_follow[1]) * 5 * ef_speed; + { + if(vieworg[1] - gunorg_follow[1] > 5) + gunorg_follow[1] = vieworg[1] - 5; + else + gunorg_follow[1] += (vieworg[1] - gunorg_follow[1]) * 5 * ef_speed; + } if(gunorg_follow[1] > vieworg[1]) - gunorg_follow[1] -= (gunorg_follow[1] - vieworg[1]) * 5 * ef_speed; + { + if(gunorg_follow[1] - vieworg[1] > 5) + gunorg_follow[1] = vieworg[1] + 5; + else + gunorg_follow[1] -= (gunorg_follow[1] - vieworg[1]) * 5 * ef_speed; + } if(gunorg_follow[2] < vieworg[2]) - gunorg_follow[2] += (vieworg[2] - gunorg_follow[2]) * 5 * ef_speed; + { + if(vieworg[2] - gunorg_follow[2] > 5) + gunorg_follow[2] = vieworg[2] - 5; + else + gunorg_follow[2] += (vieworg[2] - gunorg_follow[2]) * 5 * ef_speed; + } if(gunorg_follow[2] > vieworg[2]) - gunorg_follow[2] -= (gunorg_follow[2] - vieworg[2]) * 5 * ef_speed; + { + if(gunorg_follow[2] - vieworg[2] > 5) + gunorg_follow[2] = vieworg[2] + 5; + else + gunorg_follow[2] -= (gunorg_follow[2] - vieworg[2]) * 5 * ef_speed; + } VectorCopy(gunorg_follow, gunorg); } -- 2.39.2