From: terencehill Date: Tue, 14 Jun 2016 18:13:03 +0000 (+0200) Subject: Fix v_deathtilt effect causing the view to flicker, now it correctly tilts the view... X-Git-Tag: xonotic-v0.8.2~806^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=refs%2Fmerge-requests%2F326%2Fhead;p=xonotic%2Fxonotic-data.pk3dir.git Fix v_deathtilt effect causing the view to flicker, now it correctly tilts the view when killed and cl_eventchase_death is off --- diff --git a/qcsrc/lib/warpzone/client.qc b/qcsrc/lib/warpzone/client.qc index b539b5bcc..5a1e320e9 100644 --- a/qcsrc/lib/warpzone/client.qc +++ b/qcsrc/lib/warpzone/client.qc @@ -258,10 +258,28 @@ void WarpZone_FixView() #ifndef KEEP_ROLL float rick; float f; - if(autocvar_cl_rollkillspeed) - f = max(0, (1 - frametime * autocvar_cl_rollkillspeed)); - else + static float rollkill; + if (STAT(HEALTH) > 0 || STAT(HEALTH) == -666 || STAT(HEALTH) == -2342) + { f = 0; + // reset roll when passing through a warpzone that change player's roll angle + if(autocvar_cl_rollkillspeed) + f = max(0, (1 - frametime * autocvar_cl_rollkillspeed)); + if(rollkill) + rollkill = 0; + } + else + { + f = 1; + // roll the view when killed (v_deathtilt) + if(autocvar_cl_rollkillspeed) + { + rollkill += frametime * autocvar_cl_rollkillspeed; + f = min(1, rollkill); + } + else if(rollkill) + rollkill = 0; + } rick = getproperty(VF_CL_VIEWANGLES_Z); rick *= f;