]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'terencehill/rollkill' into 'master'
authorMario <zacjardine@y7mail.com>
Tue, 14 Jun 2016 19:14:35 +0000 (19:14 +0000)
committerMario <zacjardine@y7mail.com>
Tue, 14 Jun 2016 19:14:35 +0000 (19:14 +0000)
v_deathtilt fix

Fix v_deathtilt effect causing the view to flicker, now it correctly tilts the view when killed and cl_eventchase_death is off
The code I added runs only when the player is dead so it doesn't break the view roll reset applied when passing through an oblique warpzone.

See merge request !326

qcsrc/lib/warpzone/client.qc

index b539b5bcc33355c169838877313981427139f5a6..5a1e320e93462b32195814e54159d7ee26eab576 100644 (file)
@@ -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;