From 9956823e4f50b794be0f40632ea8c36e6eb498d2 Mon Sep 17 00:00:00 2001 From: bones_was_here Date: Fri, 3 Feb 2023 13:38:44 +1000 Subject: [PATCH] Invert bool WarpZoneLib_ExactTrigger_Touch() so it's easier to use --- qcsrc/lib/warpzone/common.qc | 2 +- qcsrc/lib/warpzone/common.qh | 2 +- qcsrc/lib/warpzone/server.qc | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/qcsrc/lib/warpzone/common.qc b/qcsrc/lib/warpzone/common.qc index 12fc316fd..4e82e2a7d 100644 --- a/qcsrc/lib/warpzone/common.qc +++ b/qcsrc/lib/warpzone/common.qc @@ -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); } diff --git a/qcsrc/lib/warpzone/common.qh b/qcsrc/lib/warpzone/common.qh index 0ddd0d052..020391528 100644 --- a/qcsrc/lib/warpzone/common.qh +++ b/qcsrc/lib/warpzone/common.qh @@ -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) diff --git a/qcsrc/lib/warpzone/server.qc b/qcsrc/lib/warpzone/server.qc index 4e7be227d..b9157d252 100644 --- a/qcsrc/lib/warpzone/server.qc +++ b/qcsrc/lib/warpzone/server.qc @@ -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! } } -- 2.39.2