int save_trace_dphitq3surfaceflags = trace_dphitq3surfaceflags;
string save_trace_dphittexturename = trace_dphittexturename;
- FOREACH_ENTITY_RADIUS_ORDERED(0.5 * (this.absmin + this.absmax), 0.5 * vlen(this.absmax - this.absmin), true, {
+ vector emin = this.absmin, emax = this.absmax;
+ // Xonotic and Nexuiz maps assume triggers will be activated by adjacent players
+ // prior to sv_legacy_bbox_expand 0 DP always did this for SVQC and never for CSQC
+ // we also need this for zero-size bboxes because radius == 0 returns nothing
+ // see also: WarpZoneLib_ExactTrigger_Touch()
+ emin -= '1 1 1';
+ emax += '1 1 1';
+
+ FOREACH_ENTITY_RADIUS_ORDERED(0.5 * (this.absmin + this.absmax), 0.5 * vlen(emin - emax), true, {
if (it.solid == SOLID_TRIGGER && it != this)
if (it.move_nomonsters != MOVE_NOMONSTERS && it.move_nomonsters != MOVE_WORLDONLY)
- if (gettouch(it) && boxesoverlap(it.absmin, it.absmax, this.absmin, this.absmax))
+ if (gettouch(it) && boxesoverlap(it.absmin, it.absmax, emin, emax))
{
trace_allsolid = false;
trace_startsolid = false;
gettouch(it)(it, this);
}
- });
+ });
trace_allsolid = save_trace_allsolid;
trace_startsolid = save_trace_startsolid;
{
if(autocvar__movetype_debug)
{
- vector mi, ma;
- if(this.solid == SOLID_BSP)
- {
- // TODO set the absolute bbox
- mi = this.mins;
- ma = this.maxs;
- }
- else
- {
- mi = this.mins;
- ma = this.maxs;
- }
- mi += this.origin;
- ma += this.origin;
-
- if(this.flags & FL_ITEM)
- {
- mi -= '15 15 1';
- ma += '15 15 1';
- }
- else
- {
- mi -= '1 1 1';
- ma += '1 1 1';
- }
-
- this.absmin = mi;
- this.absmax = ma;
+ this.absmin = this.origin + this.mins;
+ this.absmax = this.origin + this.maxs;
}
else
- {
setorigin(this, this.origin); // calls SV_LinkEdict
- #ifdef CSQC
- // NOTE: CSQC's version of setorigin doesn't expand
- this.absmin -= '1 1 1';
- this.absmax += '1 1 1';
- #endif
- }
if(touch_triggers)
_Movetype_LinkEdict_TouchAreaGrid(this);