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()
64 if (self.movedir == '0 0 0')
65 if (self.angles != '0 0 0')
67 makevectors (self.angles);
68 self.movedir = v_forward;
70 self.warpzone_isboxy = 1;
75 precache_model(self.model);
76 setmodel(self, self.model);
77 // let mapper-set mins/maxs override the model's bounds if set
78 if(mi != '0 0 0' || ma != '0 0 0')
84 self.warpzone_isboxy = 0; // enable exacttrigger matching
86 setorigin(self, self.origin);
88 setsize(self, self.mins * self.scale, self.maxs * self.scale);
90 setsize(self, self.mins, self.maxs);
91 self.movetype = MOVETYPE_NONE;
92 self.solid = SOLID_TRIGGER;