From: terencehill Date: Sun, 1 May 2016 07:28:53 +0000 (+0200) Subject: Fix cl_rollkillspeed causing the view to flicker a lot when dead if v_deathtilt is... X-Git-Tag: xonotic-v0.8.2~885^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=33e8e75ebaaf0ec6c49b3108f63c6324e964b71d;p=xonotic%2Fxonotic-data.pk3dir.git Fix cl_rollkillspeed causing the view to flicker a lot when dead if v_deathtilt is on (and chase_active is off); it now correctly smooths out transition between normal and tilted angle. Even v_idlescale was flickering the view a tiny bit because of cl_rollkillspeed (more easily noticeable with low fps) --- diff --git a/qcsrc/lib/warpzone/client.qc b/qcsrc/lib/warpzone/client.qc index 6467dad35..c93dd91ee 100644 --- a/qcsrc/lib/warpzone/client.qc +++ b/qcsrc/lib/warpzone/client.qc @@ -241,7 +241,6 @@ void WarpZone_FixView() { entity e; vector org, ang, nearclip, corner0, corner1, corner2, corner3, o; - float f; warpzone_save_view_origin = org = getpropertyvec(VF_ORIGIN); warpzone_save_view_angles = ang = getpropertyvec(VF_ANGLES); @@ -257,16 +256,21 @@ void WarpZone_FixView() WarpZone_View_Outside(); #ifndef KEEP_ROLL - float rick; - if(autocvar_cl_rollkillspeed) - f = max(0, (1 - frametime * autocvar_cl_rollkillspeed)); - else - f = 0; - - rick = getproperty(VF_CL_VIEWANGLES_Z); - rick *= f; - setproperty(VF_CL_VIEWANGLES_Z, rick); - ang.z *= f; + static float rollkill; + if (STAT(HEALTH) <= 0 && STAT(HEALTH) != -666 && STAT(HEALTH) != -2342) + { + if(autocvar_cl_rollkillspeed) + { + rollkill += frametime * autocvar_cl_rollkillspeed; + rollkill = min(1, rollkill); + } + float rick; + rick = getproperty(VF_CL_VIEWANGLES_Z) * rollkill; + setproperty(VF_CL_VIEWANGLES_Z, rick); + ang.z *= rollkill; + } + else if(rollkill) + rollkill = 0; #endif setproperty(VF_ORIGIN, org);