]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Invert bool WarpZoneLib_ExactTrigger_Touch() so it's easier to use
authorbones_was_here <bones_was_here@xonotic.au>
Fri, 3 Feb 2023 03:38:44 +0000 (13:38 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Sun, 21 May 2023 14:34:12 +0000 (00:34 +1000)
qcsrc/lib/warpzone/common.qc
qcsrc/lib/warpzone/common.qh
qcsrc/lib/warpzone/server.qc

index 12fc316fd74078131e95734385a78afe2b21bf90..4e82e2a7dd96b013461a0329a02773fb4c3059cf 100644 (file)
@@ -818,7 +818,7 @@ bool WarpZoneLib_ExactTrigger_Touch(entity this, entity toucher)
                emin += '1 1 1';
                emax -= '1 1 1';
        }
-       return !WarpZoneLib_BoxTouchesBrush(emin, emax, this, toucher);
+       return WarpZoneLib_BoxTouchesBrush(emin, emax, this, toucher);
 }
 
 
index 0ddd0d052a1a41da19c5b151b1be04b7831b1281..020391528961ce838a3f27fed7679e83bd2806f1 100644 (file)
@@ -113,5 +113,5 @@ bool WarpZoneLib_ExactTrigger_Touch(entity this, entity toucher);
 void WarpZoneLib_ExactTrigger_Init(entity this);
 
 // WARNING: this kills the trace globals
-#define EXACTTRIGGER_TOUCH(e,t) if(WarpZoneLib_ExactTrigger_Touch((e), (t))) return
+#define EXACTTRIGGER_TOUCH(e,t) if(!WarpZoneLib_ExactTrigger_Touch((e), (t))) return
 #define EXACTTRIGGER_INIT  WarpZoneLib_ExactTrigger_Init(this)
index 4e7be227ddb0ebc8331f6e9168bb45e236101405..b9157d2526c500c4250b9dfb575e604021da0934 100644 (file)
@@ -193,7 +193,7 @@ void WarpZone_Touch(entity this, entity toucher)
        if(toucher.move_movetype == MOVETYPE_NONE || toucher.move_movetype == MOVETYPE_FOLLOW || toucher.tag_entity)
                return;
 
-       if(WarpZoneLib_ExactTrigger_Touch(this, toucher))
+       if(!WarpZoneLib_ExactTrigger_Touch(this, toucher))
                return;
 
        if(WarpZone_PlaneDist(this, toucher.origin + toucher.view_ofs) >= 0) // wrong side of the trigger_warpzone (don't teleport yet)
@@ -815,7 +815,7 @@ void WarpZone_StartFrame()
                        if (warpzone_warpzones_exist) {
                                entity e = WarpZone_Find(it.origin + it.mins, it.origin + it.maxs);
                                if (e)
-                               if (!WarpZoneLib_ExactTrigger_Touch(e, it))
+                               if (WarpZoneLib_ExactTrigger_Touch(e, it))
                                if (WarpZone_PlaneDist(e, it.origin + it.view_ofs) <= 0)
                                        WarpZone_Teleport(e, it, -1, 0); // NOT triggering targets by this!
                        }
@@ -825,7 +825,7 @@ void WarpZone_StartFrame()
                        {
                                entity ent = Teleport_Find(it.origin + it.mins, it.origin + it.maxs);
                                if (ent)
-                               if (!WarpZoneLib_ExactTrigger_Touch(ent, it))
+                               if (WarpZoneLib_ExactTrigger_Touch(ent, it))
                                        Simple_TeleportPlayer(ent, it); // NOT triggering targets by this!
                        }
                }