]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mapobjects/trigger/swamp.qc
Merge branch 'terencehill/menu_registries' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mapobjects / trigger / swamp.qc
index 495deb7988693b565c3d5e9eec12816ec5d22853..061c621313494256c7b4666bbb64d792ff769e3c 100644 (file)
@@ -4,7 +4,8 @@
 #elif defined(SVQC)
     #include <lib/warpzone/util_server.qh>
     #include <common/weapons/_all.qh>
-    #include <server/defs.qh>
+    #include <common/weapons/_all.qh>
+    #include <common/stats.qh>
     #include <common/deathtypes/all.qh>
 #endif
 
@@ -30,20 +31,12 @@ void swamp_think(entity this)
        {
                FOREACH_ENTITY_RADIUS((this.absmin + this.absmax) * 0.5, vlen(this.absmax - this.absmin) * 0.5 + 1, it.swampslug.active == ACTIVE_NOT && IS_PLAYER(it) && !IS_DEAD(it),
                {
-                       vector emin = it.absmin;
-                       vector emax = it.absmax;
-                       if(this.solid == SOLID_BSP)
+                       if (WarpZoneLib_ExactTrigger_Touch(this, it, false))
                        {
-                               emin -= '1 1 1';
-                               emax += '1 1 1';
+                               if(!it.swampslug)
+                                       IL_PUSH(g_swamped, it);
+                               it.swampslug = this;
                        }
-                       if(boxesoverlap(emin, emax, this.absmin, this.absmax)) // quick
-                               if(WarpZoneLib_BoxTouchesBrush(emin, emax, this, it)) // accurate
-                               {
-                                       if(!it.swampslug)
-                                               IL_PUSH(g_swamped, it);
-                                       it.swampslug = this;
-                               }
                });
 
                IL_EACH(g_swamped, it.swampslug == this,
@@ -68,7 +61,6 @@ spawnfunc(trigger_swamp)
        // Init stuff
        EXACTTRIGGER_INIT;
        this.active = ACTIVE_ACTIVE;
-       //trigger_init(this);
        setthink(this, swamp_think);
        this.nextthink = time;