From: terencehill Date: Fri, 20 May 2011 11:36:05 +0000 (+0200) Subject: Add a check to exec the cl_velocityzoom code only if it's active X-Git-Tag: xonotic-v0.5.0~148^2~42^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=3747a7254c1a34810a64375ef4dcc693e3f9b92a;p=xonotic%2Fxonotic-data.pk3dir.git Add a check to exec the cl_velocityzoom code only if it's active --- 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;