]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/warpzonelib/client.qc
Merge remote branch 'origin/fruitiex/fruitbalance'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / warpzonelib / client.qc
index cb2ac268a22324ad04ea773f3c9a3d1fe700229f..725f84ffbd24a8f09150431c7aa44e1c2f2860d2 100644 (file)
@@ -1,9 +1,10 @@
 void WarpZone_Fade_PreDraw()
 {
        if(self.warpzone_fadestart)
-               self.alpha = (self.warpzone_fadeend - vlen(view_origin - self.origin)) / (self.warpzone_fadeend - self.warpzone_fadestart);
+               self.alpha = bound(0, (self.warpzone_fadeend - vlen(view_origin - self.origin - 0.5 * (self.mins + self.maxs))) / (self.warpzone_fadeend - self.warpzone_fadestart), 1);
        else
                self.alpha = 1;
+       //print(sprintf("%v <-> %v\n", view_origin, self.origin + 0.5 * (self.mins + self.maxs)));
        if(self.alpha <= 0)
                self.drawmask = 0;
        else
@@ -24,9 +25,14 @@ void WarpZone_Read(float isnew)
 
        f = ReadByte();
        self.warpzone_isboxy = (f & 1);
-       self.origin_x = ReadCoord();
-       self.origin_y = ReadCoord();
-       self.origin_z = ReadCoord();
+       if(f & 4)
+       {
+               self.origin_x = ReadCoord();
+               self.origin_y = ReadCoord();
+               self.origin_z = ReadCoord();
+       }
+       else
+               self.origin = '0 0 0';
        self.modelindex = ReadShort();
        self.mins_x = ReadCoord();
        self.mins_y = ReadCoord();
@@ -82,9 +88,14 @@ void WarpZone_Camera_Read(float isnew)
        self.classname = "func_warpzone_camera";
 
        f = ReadByte();
-       self.origin_x = ReadCoord();
-       self.origin_y = ReadCoord();
-       self.origin_z = ReadCoord();
+       if(f & 4)
+       {
+               self.origin_x = ReadCoord();
+               self.origin_y = ReadCoord();
+               self.origin_z = ReadCoord();
+       }
+       else
+               self.origin = '0 0 0';
        self.modelindex = ReadShort();
        self.mins_x = ReadCoord();
        self.mins_y = ReadCoord();