From 11b7d02fd0c1af73223e3ed87fbb918e75ab65ab Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 12 Mar 2016 22:11:43 +1000 Subject: [PATCH] Revert tweak to touch function (has the possibility of overwhelming clients on maps with a lot of triggers), also don't bother checking clients in trigger code (prediction doesn't allow it) --- qcsrc/common/physics/movetypes/movetypes.qc | 14 +++++++------- qcsrc/common/triggers/triggers.qc | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/qcsrc/common/physics/movetypes/movetypes.qc b/qcsrc/common/physics/movetypes/movetypes.qc index ec2761431..ce469ed6a 100644 --- a/qcsrc/common/physics/movetypes/movetypes.qc +++ b/qcsrc/common/physics/movetypes/movetypes.qc @@ -343,11 +343,11 @@ void _Movetype_LinkEdict_TouchAreaGrid(entity this) // SV_LinkEdict_TouchAreaGr entity oldother = other; - FOREACH_ENTITY_FLOAT(solid, SOLID_TRIGGER, + for (entity e = findradius(0.5 * (this.absmin + this.absmax), 0.5 * vlen(this.absmax - this.absmin)); e; e = e.chain) { - if(it != this && it.move_touch) - if(it.move_nomonsters != MOVE_NOMONSTERS && it.move_nomonsters != MOVE_WORLDONLY) - if(boxesoverlap(it.absmin, it.absmax, this.absmin, this.absmax)) + if(e.solid == SOLID_TRIGGER && e != this) + if(e.move_nomonsters != MOVE_NOMONSTERS && e.move_nomonsters != MOVE_WORLDONLY) + if(e.move_touch && boxesoverlap(e.absmin, e.absmax, this.absmin, this.absmax)) { other = this; @@ -356,14 +356,14 @@ void _Movetype_LinkEdict_TouchAreaGrid(entity this) // SV_LinkEdict_TouchAreaGr trace_fraction = 1; trace_inwater = false; trace_inopen = true; - trace_endpos = it.move_origin; + trace_endpos = e.move_origin; trace_plane_normal = '0 0 1'; trace_plane_dist = 0; trace_ent = this; - WITH(entity, self, it, it.move_touch()); + WITH(entity, self, e, e.move_touch()); } - }); + } other = oldother; } diff --git a/qcsrc/common/triggers/triggers.qc b/qcsrc/common/triggers/triggers.qc index 563364523..29cb70a7d 100644 --- a/qcsrc/common/triggers/triggers.qc +++ b/qcsrc/common/triggers/triggers.qc @@ -296,7 +296,7 @@ void trigger_touch_generic(entity this, void() touchfunc) { entity e; for(e = findradius((this.absmin + this.absmax) * 0.5, vlen(this.absmax - this.absmin) * 0.5 + 1); e; e = e.chain) - if(e.isplayermodel || e.classname == "csqcprojectile") + if(e.classname == "csqcprojectile") { vector emin = e.absmin, emax = e.absmax; if(this.solid == SOLID_BSP) -- 2.39.2