]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
optimize more warpzone functions if no WZs exist
authorRudolf Polzer <divverent@alientrap.org>
Wed, 18 Aug 2010 18:44:54 +0000 (20:44 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Wed, 18 Aug 2010 18:45:26 +0000 (20:45 +0200)
qcsrc/warpzonelib/common.qc

index d9af61894f5a515be2a5d1932e8bc62146018d68..9eb74988610b468e6db59e1fa01947dede0bb62a 100644 (file)
@@ -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;
 }