]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
stop using pmove_vel with csqcplayers here
authorRudolf Polzer <divverent@alientrap.org>
Sat, 18 Feb 2012 16:51:41 +0000 (17:51 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Sat, 18 Feb 2012 16:51:41 +0000 (17:51 +0100)
qcsrc/client/View.qc

index 4b67215c664f639fbafcf48bfb4518da1fd6c9ce..c23c2c78fdf893df760040f22a634af9201817cf 100644 (file)
@@ -94,6 +94,7 @@ vector GetCurrentFov(float fov)
 {
        float zoomsensitivity, zoomspeed, zoomfactor, zoomdir;
        float velocityzoom, curspeed;
+       vector v;
 
        zoomsensitivity = autocvar_cl_zoomsensitivity;
        zoomfactor = autocvar_cl_zoomfactor;
@@ -161,11 +162,15 @@ vector GetCurrentFov(float fov)
 
        if(autocvar_cl_velocityzoom && autocvar_cl_velocityzoom_type) // _type = 0 disables velocity zoom too
        {
+               v = pmove_vel;
+               if(csqcplayer)
+                       v = csqcplayer.velocity;
+
                switch(autocvar_cl_velocityzoom_type)
                {
-                       case 3: curspeed = max(0, v_forward * pmove_vel); break;
-                       case 2: curspeed = (v_forward * pmove_vel); break;
-                       case 1: default: curspeed = vlen(pmove_vel); break;
+                       case 3: curspeed = max(0, v_forward * v); break;
+                       case 2: curspeed = (v_forward * v); break;
+                       case 1: default: curspeed = vlen(v); break;
                }
                
                velocityzoom = bound(0, drawframetime / max(0.000000001, autocvar_cl_velocityzoom_time), 1); // speed at which the zoom adapts to player velocity