]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/lib/warpzone/client.qc
Merge branch 'master' into terencehill/scoreboard_panel_2
[xonotic/xonotic-data.pk3dir.git] / qcsrc / lib / warpzone / client.qc
index 44ae46fb14b08bcb0a63137a359c551e4b23491c..bd0397f897330d876cdede80e284e1a2062ed0cf 100644 (file)
@@ -25,7 +25,7 @@ void WarpZone_Fade_PreDraw(entity this)
                this.drawmask = MASK_NORMAL;
 }
 
-void WarpZone_Touch (entity this);
+void WarpZone_Touch(entity this, entity toucher);
 NET_HANDLE(ENT_CLIENT_WARPZONE, bool isnew)
 {
        warpzone_warpzones_exist = 1;
@@ -89,7 +89,7 @@ NET_HANDLE(ENT_CLIENT_WARPZONE, bool isnew)
        // engine currently wants this
        setpredraw(this, WarpZone_Fade_PreDraw);
 
-       //this.move_touch = WarpZone_Touch;
+       //settouch(this, WarpZone_Touch);
        return true;
 }
 
@@ -256,21 +256,35 @@ void WarpZone_FixView()
                WarpZone_View_Outside();
 
 #ifndef KEEP_ROLL
+       float rick;
+       float f;
        static float rollkill;
-       if (STAT(HEALTH) <= 0 && STAT(HEALTH) != -666 && STAT(HEALTH) != -2342)
+       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;
-                       rollkill = min(1, rollkill);
+                       f = 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;
        }
-       else if(rollkill)
-               rollkill = 0;
+
+       rick = getproperty(VF_CL_VIEWANGLES_Z);
+       rick *= f;
+       setproperty(VF_CL_VIEWANGLES_Z, rick);
+       ang.z *= f;
 #endif
 
        setproperty(VF_ORIGIN, org);