From 3747a7254c1a34810a64375ef4dcc693e3f9b92a Mon Sep 17 00:00:00 2001 From: terencehill Date: Fri, 20 May 2011 13:36:05 +0200 Subject: [PATCH] Add a check to exec the cl_velocityzoom code only if it's active --- qcsrc/client/View.qc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/qcsrc/client/View.qc b/qcsrc/client/View.qc index 029b9460f..5609c36dc 100644 --- a/qcsrc/client/View.qc +++ b/qcsrc/client/View.qc @@ -185,11 +185,15 @@ vector GetCurrentFov(float fov) else setsensitivityscale(1); - velocityzoom = bound(0, drawframetime / max(0.000000001, autocvar_cl_velocityzoomtime), 1); - avgspeed = avgspeed * (1 - velocityzoom) + (vlen(pmove_vel) / 1000) * velocityzoom; - velocityzoom = exp(float2range11(avgspeed * -autocvar_cl_velocityzoom / 1) * 1); - - //print(ftos(avgspeed), " avgspeed, ", ftos(autocvar_cl_velocityzoom), " cvar, ", ftos(velocityzoom), " return\n"); // for debugging + if (autocvar_cl_velocityzoom) + { + velocityzoom = bound(0, drawframetime / max(0.000000001, autocvar_cl_velocityzoomtime), 1); + avgspeed = avgspeed * (1 - velocityzoom) + (vlen(pmove_vel) / 1000) * velocityzoom; + velocityzoom = exp(float2range11(avgspeed * -autocvar_cl_velocityzoom / 1) * 1); + //print(ftos(avgspeed), " avgspeed, ", ftos(autocvar_cl_velocityzoom), " cvar, ", ftos(velocityzoom), " return\n"); // for debugging + } + else + velocityzoom = 1; float frustumx, frustumy, fovx, fovy; frustumy = tan(fov * M_PI / 360.0) * 0.75 * current_viewzoom * velocityzoom; -- 2.39.2