From 414abe43bfc7d7f8ce54ecb0a39ce9b049113ca2 Mon Sep 17 00:00:00 2001 From: bones_was_here Date: Sun, 13 Aug 2023 21:41:15 +1000 Subject: [PATCH] Small optimisation in WarpZone_Touch() Cheap early-out checks should be performed before expensive checks to avoid wasting CPU. --- qcsrc/lib/warpzone/server.qc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qcsrc/lib/warpzone/server.qc b/qcsrc/lib/warpzone/server.qc index d444ee6e8..f216aa9c6 100644 --- a/qcsrc/lib/warpzone/server.qc +++ b/qcsrc/lib/warpzone/server.qc @@ -193,11 +193,11 @@ void WarpZone_Touch(entity this, entity toucher) if(toucher.move_movetype == MOVETYPE_NONE || toucher.move_movetype == MOVETYPE_FOLLOW || toucher.tag_entity) return; - EXACTTRIGGER_TOUCH(this, toucher); - if(WarpZone_PlaneDist(this, toucher.origin + toucher.view_ofs) >= 0) // wrong side of the trigger_warpzone (don't teleport yet) return; + EXACTTRIGGER_TOUCH(this, toucher); + float f; // number of frames we need to go back: // dist = 16*sqrt(2) qu -- 2.39.2