// --------------------------------------------------------------------------
// BEGIN OPTIONAL CSQC FUNCTIONS
+void trigger_touch_generic(void() touchfunc)
+{
+ entity e;
+ for(e = findradius((self.absmin + self.absmax) * 0.5, vlen(self.absmax - self.absmin) * 0.5 + 1); e; e = e.chain)
+ if(e.isplayermodel)
+ {
+ vector emin = e.absmin, emax = e.absmax;
+ if(self.solid == SOLID_BSP)
+ {
+ emin -= '1 1 1';
+ emax += '1 1 1';
+ }
+ if(boxesoverlap(emin, emax, self.absmin, self.absmax)) // quick
+ if(WarpZoneLib_BoxTouchesBrush(emin, emax, self, e)) // accurate
+ {
+ other = e;
+ touchfunc();
+ }
+ }
+}
+
void Ent_RemoveEntCS()
{
entcs_receiver[self.sv_entnum] = world;
self.move_time = time;
if(dt <= 0) { return; }
- entity e;
-
- for(e = findradius((self.absmin + self.absmax) * 0.5, vlen(self.absmax - self.absmin) * 0.5 + 1); e; e = e.chain)
- if(e.isplayermodel)
- {
- vector emin = e.absmin;
- vector emax = e.absmax;
- if(self.solid == SOLID_BSP)
- {
- emin -= '1 1 1';
- emax += '1 1 1';
- }
- if(boxesoverlap(emin, emax, self.absmin, self.absmax)) // quick
- if(WarpZoneLib_BoxTouchesBrush(emin, emax, self, e)) // accurate
- {
- other = e;
- func_ladder_touch();
- }
- }
+ trigger_touch_generic(func_ladder_touch);
}
void ent_func_ladder()
#ifdef CSQC
void trigger_push_draw()
{
- /*float dt = time - self.move_time;
+ float dt = time - self.move_time;
self.move_time = time;
- if(dt <= 0)
- return;*/
+ if(dt <= 0) { return; }
- tracebox(self.origin, self.mins, self.maxs, self.origin, MOVE_NORMAL, self);
-
- //if(trace_fraction < 1)
- if(trace_ent)
- {
- other = trace_ent;
- trigger_push_touch();
- }
+ trigger_touch_generic(trigger_push_touch);
}
void ent_trigger_push()