From 6206ece74b97d932420b36207498263503fe87f5 Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 25 Mar 2015 01:32:57 +1100 Subject: [PATCH] Use engine side touch on triggers --- qcsrc/common/triggers/trigger/hurt.qc | 4 +--- qcsrc/common/triggers/trigger/jumppads.qc | 4 +--- qcsrc/common/triggers/triggers.qc | 25 ----------------------- 3 files changed, 2 insertions(+), 31 deletions(-) diff --git a/qcsrc/common/triggers/trigger/hurt.qc b/qcsrc/common/triggers/trigger/hurt.qc index d39c32c41..3a15a77ff 100644 --- a/qcsrc/common/triggers/trigger/hurt.qc +++ b/qcsrc/common/triggers/trigger/hurt.qc @@ -61,9 +61,7 @@ void spawnfunc_trigger_hurt() { EXACTTRIGGER_INIT; self.active = ACTIVE_ACTIVE; - self.trigger_touch = trigger_hurt_touch; - self.think = trigger_think_generic; - self.nextthink = time; + self.touch = trigger_hurt_touch; self.use = trigger_hurt_use; self.enemy = world; // I hate you all if (!self.dmg) diff --git a/qcsrc/common/triggers/trigger/jumppads.qc b/qcsrc/common/triggers/trigger/jumppads.qc index a78ef9913..4b1044acf 100644 --- a/qcsrc/common/triggers/trigger/jumppads.qc +++ b/qcsrc/common/triggers/trigger/jumppads.qc @@ -375,9 +375,7 @@ void spawnfunc_trigger_push() self.active = ACTIVE_ACTIVE; self.use = trigger_push_use; - self.trigger_touch = trigger_push_touch; - self.think = trigger_think_generic; - self.nextthink = time; + self.touch = trigger_push_touch; // normal push setup if (!self.speed) diff --git a/qcsrc/common/triggers/triggers.qc b/qcsrc/common/triggers/triggers.qc index ece5781e1..b1030fd96 100644 --- a/qcsrc/common/triggers/triggers.qc +++ b/qcsrc/common/triggers/triggers.qc @@ -273,31 +273,6 @@ void SUB_UseTargets_Ex(bool preventReuse) void SUB_UseTargets() { SUB_UseTargets_Ex(false); } void SUB_UseTargets_PreventReuse() { SUB_UseTargets_Ex(true); } -#ifdef SVQC -void trigger_think_generic() -{ - self.nextthink = time; - - entity e; - if(self.trigger_touch) - for(e = findradius((self.absmin + self.absmax) * 0.5, vlen(self.absmax - self.absmin) * 0.5 + 1); e; e = e.chain) - { - 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; - self.trigger_touch(); - } - } -} -#endif - #ifdef CSQC void trigger_touch_generic(void() touchfunc) { -- 2.39.2