1 void WarpZoneLib_MoveOutOfSolid_Expand(entity e, vector by)
4 tracebox(e.origin, e.mins - '1 1 1' * eps, e.maxs + '1 1 1' * eps, e.origin + by, MOVE_WORLDONLY, e);
7 if (trace_fraction < 1)
10 // adjust origin in the other direction...
11 setorigin(e,e.origin - by * (1 - trace_fraction));
15 float WarpZoneLib_MoveOutOfSolid(entity e)
20 traceline(o, o, MOVE_WORLDONLY, e);
24 tracebox(o, e.mins, e.maxs, o, MOVE_WORLDONLY, e);
25 if (!trace_startsolid)
32 WarpZoneLib_MoveOutOfSolid_Expand(e, '1 0 0' * m0_x);
34 WarpZoneLib_MoveOutOfSolid_Expand(e, '1 0 0' * m1_x);
36 WarpZoneLib_MoveOutOfSolid_Expand(e, '0 1 0' * m0_y);
38 WarpZoneLib_MoveOutOfSolid_Expand(e, '0 1 0' * m1_y);
40 WarpZoneLib_MoveOutOfSolid_Expand(e, '0 0 1' * m0_z);
42 WarpZoneLib_MoveOutOfSolid_Expand(e, '0 0 1' * m1_z);
44 setorigin(e, e.origin);
46 tracebox(e.origin, e.mins, e.maxs, e.origin, MOVE_WORLDONLY, e);
56 float WarpZoneLib_ExactTrigger_Touch()
58 return !WarpZoneLib_BoxTouchesBrush(other.absmin, other.absmax, self, other);
61 void WarpZoneLib_ExactTrigger_Init()
63 if (self.movedir == '0 0 0')
64 if (self.angles != '0 0 0')
66 makevectors (self.angles);
67 self.movedir = v_forward;
71 precache_model(self.model);
72 setmodel(self, self.model);
74 setorigin(self, self.origin);
76 setsize(self, self.mins * self.scale, self.maxs * self.scale);
78 setsize(self, self.mins, self.maxs);
79 self.movetype = MOVETYPE_NONE;
80 self.solid = SOLID_TRIGGER;