]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
skip the WarpZone_StoreProjectileData loop if there are no warpzones
authorRudolf Polzer <divverent@alientrap.org>
Sat, 2 Apr 2011 19:33:55 +0000 (21:33 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Sat, 2 Apr 2011 19:33:55 +0000 (21:33 +0200)
qcsrc/warpzonelib/server.qc

index f4141c8a3df01899ca3754c2bcb20c8a98f24cfe..e0dfc6675342eb9282283f6f6599398896370e4a 100644 (file)
@@ -605,37 +605,40 @@ void WarpZone_StartFrame()
                WarpZones_Reconnect();
        }
 
-       entity oldself, oldother;
-       oldself = self;
-       oldother = other;
-       for(e = world; (e = nextent(e)); )
+       if(warpzone_warpzones_exist)
        {
-               WarpZone_StoreProjectileData(e);
-               float f;
-               f = clienttype(e);
-               if(f == CLIENTTYPE_REAL)
-               {
-                       if(e.solid != SOLID_NOT) // not spectating?
-                               continue;
-                       if(e.movetype != MOVETYPE_NOCLIP && e.movetype != MOVETYPE_FLY) // not spectating? (this is to catch observers)
-                               continue;
-                       self = WarpZone_Find(e.origin + e.mins, e.origin + e.maxs);
-                       if(!self)
-                               continue;
-                       other = e;
-                       if(WarpZoneLib_ExactTrigger_Touch())
-                               continue;
-                       WarpZone_Teleport(e); // NOT triggering targets by this!
-               }
-               if(f == CLIENTTYPE_NOTACLIENT)
+               entity oldself, oldother;
+               oldself = self;
+               oldother = other;
+               for(e = world; (e = nextent(e)); )
                {
-                       for(; (e = nextent(e)); )
-                               WarpZone_StoreProjectileData(e);
-                       break;
+                       WarpZone_StoreProjectileData(e);
+                       float f;
+                       f = clienttype(e);
+                       if(f == CLIENTTYPE_REAL)
+                       {
+                               if(e.solid != SOLID_NOT) // not spectating?
+                                       continue;
+                               if(e.movetype != MOVETYPE_NOCLIP && e.movetype != MOVETYPE_FLY) // not spectating? (this is to catch observers)
+                                       continue;
+                               self = WarpZone_Find(e.origin + e.mins, e.origin + e.maxs);
+                               if(!self)
+                                       continue;
+                               other = e;
+                               if(WarpZoneLib_ExactTrigger_Touch())
+                                       continue;
+                               WarpZone_Teleport(e); // NOT triggering targets by this!
+                       }
+                       if(f == CLIENTTYPE_NOTACLIENT)
+                       {
+                               for(; (e = nextent(e)); )
+                                       WarpZone_StoreProjectileData(e);
+                               break;
+                       }
                }
+               self = oldself;
+               other = oldother;
        }
-       self = oldself;
-       other = oldother;
 }
 
 .float warpzone_reconnecting;