#include "common.qh"
#if defined(CSQC)
- #include <common/t_items.qh>
+ #include <client/items/items.qh>
#elif defined(MENUQC)
#elif defined(SVQC)
#include <common/weapons/_all.qh>
e.warpzone_targetorigin = other_org;
e.warpzone_angles = my_ang;
e.warpzone_targetangles = other_ang;
- fixedmakevectors(my_ang); e.warpzone_forward = v_forward;
- fixedmakevectors(other_ang); e.warpzone_targetforward = v_forward;
+ vector forward, right, up;
+ FIXED_MAKE_VECTORS(my_ang, forward, right, up);
+ e.warpzone_forward = forward;
+ FIXED_MAKE_VECTORS(other_ang, forward, right, up);
+ e.warpzone_targetforward = forward;
setcamera_transform(e, WarpZone_camera_transform);
}
float nomonsters_adjusted;
float frac, sol, i;
float contentshack;
- vector o0, e0;
entity wz;
vector vf, vr, vu;
vf = v_forward;
vr = v_right;
vu = v_up;
- o0 = org;
- e0 = end;
switch(nomonsters)
{
}
break;
}
- if(trace_ent == wz)
+ /*if(trace_ent == wz)
{
// FIXME can this check be removed? Do we really need it?
LOG_TRACE("I transformed into the same zone again, wtf, aborting the trace");
trace_ent = NULL;
break;
- }
+ }*/
wz = trace_ent;
if(!WarpZone_trace_firstzone)
WarpZone_trace_firstzone = wz;
{
if (is_pure(e)) return true;
string s = e.classname;
- switch (s)
- {
- // case "net_linked": // actually some real entities are linked without classname, fail
- case "":
- return true;
- }
+
+ //if (s == "net_linked") return true; // actually some real entities are linked without classname, fail
+ if (s == "") return true;
if (startsWith(s, "target_")) return true;
}
entity WarpZone_RefSys_SpawnSameRefSys(entity me)
{
- entity e;
- e = spawn();
+ entity e = spawn();
WarpZone_RefSys_Copy(e, me);
return e;
}
-float WarpZoneLib_ExactTrigger_Touch(entity this, entity toucher)
+bool WarpZoneLib_ExactTrigger_Touch(entity this, entity toucher)
{
- return !WarpZoneLib_BoxTouchesBrush(toucher.absmin, toucher.absmax, this, toucher);
+ vector emin = toucher.absmin, emax = toucher.absmax;
+ if(STAT(Q3COMPAT))
+ {
+ // DP's tracebox enlarges absolute bounding boxes by a single quake unit
+ // we must undo that here to allow accurate touching
+ emin += '1 1 1';
+ emax -= '1 1 1';
+ }
+ return !WarpZoneLib_BoxTouchesBrush(emin, emax, this, toucher);
}
void WarpZoneLib_MoveOutOfSolid_Expand(entity e, vector by)
{
- float eps = 0.0625;
+ const float eps = 0.0625;
tracebox(e.origin, e.mins - '1 1 1' * eps, e.maxs + '1 1 1' * eps, e.origin + by, MOVE_WORLDONLY, e);
if (trace_startsolid)
return;
}
}
-float WarpZoneLib_MoveOutOfSolid(entity e)
+bool WarpZoneLib_MoveOutOfSolid(entity e)
{
- vector o, m0, m1;
-
- o = e.origin;
+ vector o = e.origin;
traceline(o, o, MOVE_WORLDONLY, e);
if (trace_startsolid)
return false;
if (!trace_startsolid)
return true;
- m0 = e.mins;
- m1 = e.maxs;
+ vector m0 = e.mins;
+ vector m1 = e.maxs;
e.mins = '0 0 0';
e.maxs = '0 0 0';
- WarpZoneLib_MoveOutOfSolid_Expand(e, '1 0 0' * m0_x);
- e.mins_x = m0_x;
- WarpZoneLib_MoveOutOfSolid_Expand(e, '1 0 0' * m1_x);
- e.maxs_x = m1_x;
- WarpZoneLib_MoveOutOfSolid_Expand(e, '0 1 0' * m0_y);
- e.mins_y = m0_y;
- WarpZoneLib_MoveOutOfSolid_Expand(e, '0 1 0' * m1_y);
- e.maxs_y = m1_y;
- WarpZoneLib_MoveOutOfSolid_Expand(e, '0 0 1' * m0_z);
- e.mins_z = m0_z;
- WarpZoneLib_MoveOutOfSolid_Expand(e, '0 0 1' * m1_z);
- e.maxs_z = m1_z;
+ WarpZoneLib_MoveOutOfSolid_Expand(e, eX * m0.x); e.mins_x = m0.x;
+ WarpZoneLib_MoveOutOfSolid_Expand(e, eX * m1.x); e.maxs_x = m1.x;
+ WarpZoneLib_MoveOutOfSolid_Expand(e, eY * m0.y); e.mins_y = m0.y;
+ WarpZoneLib_MoveOutOfSolid_Expand(e, eY * m1.y); e.maxs_y = m1.y;
+ WarpZoneLib_MoveOutOfSolid_Expand(e, eZ * m0.z); e.mins_z = m0.z;
+ WarpZoneLib_MoveOutOfSolid_Expand(e, eZ * m1.z); e.maxs_z = m1.z;
setorigin(e, e.origin);
tracebox(e.origin, e.mins, e.maxs, e.origin, MOVE_WORLDONLY, e);