]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/lib/warpzone/common.qc
Merge branch 'LegendaryGuard/avoid_spam_map_custom_fields' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / lib / warpzone / common.qc
index 12fc316fd74078131e95734385a78afe2b21bf90..d9a12517d1512efa663e3d5234eae467156edaf8 100644 (file)
@@ -808,7 +808,7 @@ entity WarpZone_RefSys_SpawnSameRefSys(entity me)
        return e;
 }
 
-bool WarpZoneLib_ExactTrigger_Touch(entity this, entity toucher)
+bool WarpZoneLib_ExactTrigger_Touch(entity this, entity toucher, bool touchfunc)
 {
        vector emin = toucher.absmin, emax = toucher.absmax;
        if(STAT(Q3COMPAT))
@@ -818,7 +818,12 @@ bool WarpZoneLib_ExactTrigger_Touch(entity this, entity toucher)
                emin += '1 1 1';
                emax -= '1 1 1';
        }
-       return !WarpZoneLib_BoxTouchesBrush(emin, emax, this, toucher);
+
+       // if called from a touch func, we can assume the boxes do overlap
+       if (!touchfunc && !boxesoverlap(emin, emax, this.absmin, this.absmax)) // quick
+               return false;
+
+       return WarpZoneLib_BoxTouchesBrush(emin, emax, this, toucher); // accurate
 }