+#if defined(CSQC)
+#elif defined(MENUQC)
+#elif defined(SVQC)
+ #include "../dpdefs/progsdefs.qh"
+ #include "../dpdefs/dpextensions.qh"
+ #include "common.qh"
+ #include "server.qh"
+ #include "../common/constants.qh"
+ #include "../common/util.qh"
+ #include "../server/constants.qh"
+ #include "../server/defs.qh"
+ #include "../server/command/common.qh"
+#endif
+
#ifdef WARPZONELIB_KEEPDEBUG
#define WARPZONELIB_REMOVEHACK
#endif
WarpZone_PostTeleportPlayer_Callback(player);
}
-float WarpZone_Teleported_Send(entity to, float sf)
+bool WarpZone_Teleported_Send(entity to, int sf)
{
WriteByte(MSG_ENTITY, ENT_CLIENT_WARPZONE_TELEPORTED);
WriteCoord(MSG_ENTITY, self.angles.x);
}
}
-float WarpZone_Send(entity to, float sendflags)
+bool WarpZone_Send(entity to, int sendflags)
{
- float f;
WriteByte(MSG_ENTITY, ENT_CLIENT_WARPZONE);
// we must send this flag for clientside to match properly too
- f = 0;
+ int f = 0;
if(self.warpzone_isboxy)
BITSET_ASSIGN(f, 1);
if(self.warpzone_fadestart)
return true;
}
-float WarpZone_Camera_Send(entity to, float sendflags)
+bool WarpZone_Camera_Send(entity to, int sendflags)
{
- float f = 0;
+ int f = 0;
WriteByte(MSG_ENTITY, ENT_CLIENT_WARPZONE_CAMERA);
if(self.warpzone_fadestart)
{
vector org, ang, norm, point;
float area;
- vector tri, a, b, c, p, q, n;
+ vector tri, a, b, c, n;
float i_s, i_t, n_t;
string tex;
a = getsurfacepoint(self, i_s, tri.x);
b = getsurfacepoint(self, i_s, tri.y);
c = getsurfacepoint(self, i_s, tri.z);
- p = b - a;
- q = c - a;
- n = '1 0 0' * (q.y * p.z - q.z * p.y)
- + '0 1 0' * (q.z * p.x - q.x * p.z)
- + '0 0 1' * (q.x * p.y - q.y * p.x);
+ n = cross(c - a, b - a);
area = area + vlen(n);
norm = norm + n;
point = point + vlen(n) * (a + b + c);
norm = -1 * norm;
}
ang = vectoangles2(norm, v_up); // keep rotation, but turn exactly against plane
- ang_x = -ang.x;
+ ang.x = -ang.x;
if(norm * v_forward < 0.99)
print("trigger_warpzone near ", vtos(self.aiment.origin), " has been turned to match plane orientation (", vtos(self.aiment.angles), " -> ", vtos(ang), "\n");
if(vlen(org - self.aiment.origin) > 0.5)
{
org = point;
ang = vectoangles(norm);
- ang_x = -ang.x;
+ ang.x = -ang.x;
}
else
error("cannot infer origin/angles for this warpzone, please use a killtarget or a trigger_warpzone_position");
}
float warpzone_initialized;
-entity warpzone_first;
+//entity warpzone_first;
entity warpzone_position_first;
entity warpzone_camera_first;
.entity warpzone_next;
if(IS_NOT_A_CLIENT(e))
{
if(warpzone_warpzones_exist)
- for(0; (e = nextent(e)); )
+ for (; (e = nextent(e)); )
WarpZone_StoreProjectileData(e);
break;
}