]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
make warpzones able to transport spectators too now
authorRudolf Polzer <divverent@alientrap.org>
Tue, 14 Dec 2010 18:43:08 +0000 (19:43 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Tue, 14 Dec 2010 18:43:08 +0000 (19:43 +0100)
qcsrc/warpzonelib/server.qc

index f71fbe2d985b37fc9279f11f98009f307c5540c5..153ca6141306714722eede441e598ed4da1a322e 100644 (file)
@@ -604,8 +604,36 @@ void WarpZone_StartFrame()
                self = e;
                WarpZones_Reconnect();
        }
+
+       entity oldself, oldother;
+       oldself = self;
+       oldother = other;
        for(e = world; (e = nextent(e)); )
+       {
                WarpZone_StoreProjectileData(e);
+               float f;
+               f = clienttype(e);
+               if(f == CLIENTTYPE_REAL)
+               {
+                       if(e.solid != SOLID_NOT) // not spectating?
+                               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;
 }
 
 .float warpzone_reconnecting;