]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Offset exact trigger testing by a single QU to account for the engine's default offse...
authorMario <mario.mario@y7mail.com>
Sun, 31 May 2020 12:37:49 +0000 (22:37 +1000)
committerMario <mario.mario@y7mail.com>
Sun, 31 May 2020 12:37:59 +0000 (22:37 +1000)
qcsrc/lib/warpzone/common.qc

index 3bff39be1fd954f89ff4984828aa0af67dad42bd..120551b4e3595dccc9506f4fea2908639c4095cf 100644 (file)
@@ -786,7 +786,12 @@ entity WarpZone_RefSys_SpawnSameRefSys(entity me)
 
 bool WarpZoneLib_ExactTrigger_Touch(entity this, entity toucher)
 {
-       return !WarpZoneLib_BoxTouchesBrush(toucher.absmin, toucher.absmax, this, toucher);
+       vector emin = toucher.absmin, emax = toucher.absmax;
+       // the engine offsets absolute bounding boxes by a single quake unit
+       // we must undo that here to allow accurate touching
+       emin += '1 1 1';
+       emax -= '1 1 1';
+       return !WarpZoneLib_BoxTouchesBrush(emin, emax, this, toucher);
 }