X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fmapobjects%2Ftrigger%2Fviewloc.qc;h=9efaf9588d55a17d03e9d8ee549034c0ddff132e;hb=2e30632598aee1914eddcabf35a7774be816b069;hp=4679e75f7f0f521c4248676365578de1e10b6851;hpb=ee6a8d98fd285c5625e938984daa6fe2fd949d96;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/mapobjects/trigger/viewloc.qc b/qcsrc/common/mapobjects/trigger/viewloc.qc index 4679e75f7..9efaf9588 100644 --- a/qcsrc/common/mapobjects/trigger/viewloc.qc +++ b/qcsrc/common/mapobjects/trigger/viewloc.qc @@ -32,37 +32,16 @@ void viewloc_think(entity this) #if 1 FOREACH_CLIENT(!it.viewloc && IS_PLAYER(it), { - vector emin = it.absmin; - vector emax = it.absmax; - if(this.solid == SOLID_BSP) - { - emin -= '1 1 1'; - emax += '1 1 1'; - } - if(boxesoverlap(emin, emax, this.absmin, this.absmax)) // quick - { - if(WarpZoneLib_BoxTouchesBrush(emin, emax, this, it)) // accurate - it.viewloc = this; - } + if (WarpZoneLib_ExactTrigger_Touch(this, it, false)) + it.viewloc = this; }); #else - - for(e = findradius((this.absmin + this.absmax) * 0.5, vlen(this.absmax - this.absmin) * 0.5 + 1); e; e = e.chain) - if(!e.viewloc) - if(IS_PLAYER(e)) // should we support non-player entities with this? - //if(!IS_DEAD(e)) // death view is handled separately, we can't override this just yet - { - vector emin = e.absmin; - vector emax = e.absmax; - if(this.solid == SOLID_BSP) - { - emin -= '1 1 1'; - emax += '1 1 1'; - } - if(boxesoverlap(emin, emax, this.absmin, this.absmax)) // quick - if(WarpZoneLib_BoxTouchesBrush(emin, emax, this, e)) // accurate - e.viewloc = this; - } + for(e = findradius((this.absmin + this.absmax) * 0.5, vlen(this.absmax - this.absmin) * 0.5 + 1); e; e = e.chain) + if(!e.viewloc) + if(IS_PLAYER(e)) // should we support non-player entities with this? + //if(!IS_DEAD(e)) // death view is handled separately, we can't override this just yet + if (WarpZoneLib_ExactTrigger_Touch(this, it, false)) + e.viewloc = this; #endif this.nextthink = time; @@ -115,7 +94,7 @@ spawnfunc(trigger_viewlocation) // we won't check target2 here yet, as it may not even need to exist if(this.target == "") { LOG_INFO("^1FAIL!"); delete(this); return; } - EXACTTRIGGER_INIT; + WarpZoneLib_ExactTrigger_Init(this, false); InitializeEntity(this, viewloc_init, INITPRIO_FINDTARGET); }