Xonotic
util_server.qh File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

bool WarpZoneLib_ExactTrigger_Touch (entity this, entity toucher)
 
bool WarpZoneLib_MoveOutOfSolid (entity e)
 

Function Documentation

◆ WarpZoneLib_ExactTrigger_Touch()

bool WarpZoneLib_ExactTrigger_Touch ( entity  this,
entity  toucher 
)

Definition at line 798 of file common.qc.

References vector(), and WarpZoneLib_BoxTouchesBrush().

Referenced by WarpZone_Projectile_Touch(), and WarpZone_Touch().

799 {
800  vector emin = toucher.absmin, emax = toucher.absmax;
801  if(STAT(Q3COMPAT))
802  {
803  // DP's tracebox enlarges absolute bounding boxes by a single quake unit
804  // we must undo that here to allow accurate touching
805  emin += '1 1 1';
806  emax -= '1 1 1';
807  }
808  return !WarpZoneLib_BoxTouchesBrush(emin, emax, this, toucher);
809 }
float WarpZoneLib_BoxTouchesBrush(vector mi, vector ma, entity e, entity ig)
Definition: common.qc:138
vector(float skel, float bonenum) _skel_get_boneabs_hidden
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ WarpZoneLib_MoveOutOfSolid()

bool WarpZoneLib_MoveOutOfSolid ( entity  e)

Definition at line 826 of file common.qc.

References eX, eY, eZ, MOVE_WORLDONLY, setorigin(), trace_startsolid, vector(), and WarpZoneLib_MoveOutOfSolid_Expand().

Referenced by WarpZone_Teleport().

827 {
828  vector o = e.origin;
829  traceline(o, o, MOVE_WORLDONLY, e);
830  if (trace_startsolid)
831  return false;
832 
833  tracebox(o, e.mins, e.maxs, o, MOVE_WORLDONLY, e);
834  if (!trace_startsolid)
835  return true;
836 
837  vector m0 = e.mins;
838  vector m1 = e.maxs;
839  e.mins = '0 0 0';
840  e.maxs = '0 0 0';
841  WarpZoneLib_MoveOutOfSolid_Expand(e, eX * m0.x); e.mins_x = m0.x;
842  WarpZoneLib_MoveOutOfSolid_Expand(e, eX * m1.x); e.maxs_x = m1.x;
843  WarpZoneLib_MoveOutOfSolid_Expand(e, eY * m0.y); e.mins_y = m0.y;
844  WarpZoneLib_MoveOutOfSolid_Expand(e, eY * m1.y); e.maxs_y = m1.y;
845  WarpZoneLib_MoveOutOfSolid_Expand(e, eZ * m0.z); e.mins_z = m0.z;
846  WarpZoneLib_MoveOutOfSolid_Expand(e, eZ * m1.z); e.maxs_z = m1.z;
847  setorigin(e, e.origin);
848 
849  tracebox(e.origin, e.mins, e.maxs, e.origin, MOVE_WORLDONLY, e);
850  if (trace_startsolid)
851  {
852  setorigin(e, o);
853  return false;
854  }
855 
856  return true;
857 }
const vector eY
Definition: vector.qh:45
vector(float skel, float bonenum) _skel_get_boneabs_hidden
void WarpZoneLib_MoveOutOfSolid_Expand(entity e, vector by)
Definition: common.qc:812
const vector eX
Definition: vector.qh:44
const vector eZ
Definition: vector.qh:46
setorigin(ent, v)
float trace_startsolid
Definition: csprogsdefs.qc:35
float MOVE_WORLDONLY
+ Here is the call graph for this function:
+ Here is the caller graph for this function: