Merge branch 'terencehill/v_deathtilt_fix' into 'master'
authorMario <zacjardine@y7mail.com>
Wed, 8 Jun 2016 08:39:57 +0000 (08:39 +0000)
committerMario <zacjardine@y7mail.com>
Wed, 8 Jun 2016 08:39:57 +0000 (08:39 +0000)
v_deathtilt fix

See merge request !315

qcsrc/lib/csqcmodel/cl_player.qc
qcsrc/lib/warpzone/client.qc

index 13fb927..0b0de75 100644 (file)
@@ -333,7 +333,7 @@ void CSQCPlayer_SetCamera()
                if (view.csqcmodel_teleported) refdefflags |= REFDEFFLAG_TELEPORTED;
                if (input_buttons & BIT(1)) refdefflags |= REFDEFFLAG_JUMPING;
                // note: these two only work in WIP2, but are harmless in WIP1
-               if (STAT(HEALTH) <= 0) refdefflags |= REFDEFFLAG_DEAD;
+               if (STAT(HEALTH) <= 0 && STAT(HEALTH) != -666 && STAT(HEALTH) != -2342) refdefflags |= REFDEFFLAG_DEAD;
                if (intermission) refdefflags |= REFDEFFLAG_INTERMISSION;
                V_CalcRefdef(view, refdefflags);
        }
index 04f0378..44ae46f 100644 (file)
@@ -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);