From 3fae77ec6bebcdbb19676238e8ac5339ef83063b Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Wed, 18 Aug 2010 20:44:54 +0200 Subject: [PATCH] optimize more warpzone functions if no WZs exist --- qcsrc/warpzonelib/common.qc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/qcsrc/warpzonelib/common.qc b/qcsrc/warpzonelib/common.qc index d9af61894..9eb749886 100644 --- a/qcsrc/warpzonelib/common.qc +++ b/qcsrc/warpzonelib/common.qc @@ -132,6 +132,8 @@ entity WarpZone_Find(vector mi, vector ma) { // if we are near any warpzone planes - MOVE AWAY (work around nearclip) entity e; + if(!warpzone_warpzones_exist) + return world; for(e = world; (e = find(e, classname, "trigger_warpzone")); ) if(WarpZoneLib_BoxTouchesBrush(mi, ma, e, world)) return e; @@ -141,6 +143,8 @@ entity WarpZone_Find(vector mi, vector ma) void WarpZone_MakeAllSolid() { entity e; + if(!warpzone_warpzones_exist) + return; for(e = world; (e = find(e, classname, "trigger_warpzone")); ) e.solid = SOLID_BSP; } @@ -148,6 +152,8 @@ void WarpZone_MakeAllSolid() void WarpZone_MakeAllOther() { entity e; + if(!warpzone_warpzones_exist) + return; for(e = world; (e = find(e, classname, "trigger_warpzone")); ) e.solid = SOLID_TRIGGER; } -- 2.39.2