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 = (self.warpzone_fadeend - vlen(view_origin - self.origin - 0.5 * (self.mins + self.maxs))) / (self.warpzone_fadeend - self.warpzone_fadestart);
else
self.alpha = 1;
if(self.alpha <= 0)
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();
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();
f |= 1;
if(self.warpzone_fadestart)
f |= 2;
+ if(self.origin != '0 0 0')
+ f |= 4;
WriteByte(MSG_ENTITY, f);
// we need THESE to render the warpzone (and cull properly)...
- WriteCoord(MSG_ENTITY, self.origin_x);
- WriteCoord(MSG_ENTITY, self.origin_y);
- WriteCoord(MSG_ENTITY, self.origin_z);
+ if(f & 4)
+ {
+ WriteCoord(MSG_ENTITY, self.origin_x);
+ WriteCoord(MSG_ENTITY, self.origin_y);
+ WriteCoord(MSG_ENTITY, self.origin_z);
+ }
WriteShort(MSG_ENTITY, self.modelindex);
WriteCoord(MSG_ENTITY, self.mins_x);
if(self.warpzone_fadestart)
f |= 2;
+ if(self.origin != '0 0 0')
+ f |= 4;
WriteByte(MSG_ENTITY, f);
// we need THESE to render the warpzone (and cull properly)...
- WriteCoord(MSG_ENTITY, self.origin_x);
- WriteCoord(MSG_ENTITY, self.origin_y);
- WriteCoord(MSG_ENTITY, self.origin_z);
+ if(f & 4)
+ {
+ WriteCoord(MSG_ENTITY, self.origin_x);
+ WriteCoord(MSG_ENTITY, self.origin_y);
+ WriteCoord(MSG_ENTITY, self.origin_z);
+ }
WriteShort(MSG_ENTITY, self.modelindex);
WriteCoord(MSG_ENTITY, self.mins_x);