]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/warpzonelib/server.qc
Merge remote branch 'origin/master' into samual/flyingspectators
[xonotic/xonotic-data.pk3dir.git] / qcsrc / warpzonelib / server.qc
index 4d44fe84e73327d4ff9a7762dcf35daa56ae72ad..fd23bb854efaecbd7fe20481db03b90f45e1d222 100644 (file)
@@ -773,41 +773,47 @@ void WarpZone_StartFrame()
                WarpZone_PostInitialize_Callback();
        }
 
-       if(warpzone_warpzones_exist)
+       entity oldself, oldother;
+       oldself = self;
+       oldother = other;
+       for(e = world; (e = nextent(e)); )
        {
-               entity oldself, oldother;
-               oldself = self;
-               oldother = other;
-               for(e = world; (e = nextent(e)); )
+               if(warpzone_warpzones_exist) { WarpZone_StoreProjectileData(e); }
+               
+               float f = clienttype(e);
+               if(f == CLIENTTYPE_REAL)
                {
-                       WarpZone_StoreProjectileData(e);
-                       float f;
-                       f = clienttype(e);
-                       if(f == CLIENTTYPE_REAL)
+                       if(e.solid == SOLID_NOT) // not spectating?
+                       if(e.movetype == MOVETYPE_NOCLIP || e.movetype == MOVETYPE_FLY) // not spectating? (this is to catch observers)
                        {
-                               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;
-                               if(WarpZone_PlaneDist(self, e.origin + e.view_ofs) <= 0)
-                                       WarpZone_Teleport(self, e, -1, 0); // NOT triggering targets by this!
+                               other = e; // player
+                       
+                               // warpzones
+                               if(warpzone_warpzones_exist) { 
+                               self = WarpZone_Find(e.origin + e.mins, e.origin + e.maxs); 
+                               if(self)
+                               if(!WarpZoneLib_ExactTrigger_Touch())
+                                       if(WarpZone_PlaneDist(self, e.origin + e.view_ofs) <= 0)
+                                               WarpZone_Teleport(self, e, -1, 0); } // NOT triggering targets by this!
+                       
+                               // teleporters
+                               self = Teleport_Find(e.origin + e.mins, e.origin + e.maxs);
+                               if(self)
+                               if(!WarpZoneLib_ExactTrigger_Touch())
+                                       Simple_TeleportPlayer(self, other); // NOT triggering targets by this!
                        }
-                       if(f == CLIENTTYPE_NOTACLIENT)
-                       {
+               }
+               
+               if(f == CLIENTTYPE_NOTACLIENT)
+               {
+                       if(warpzone_warpzones_exist)
                                for(; (e = nextent(e)); )
                                        WarpZone_StoreProjectileData(e);
-                               break;
-                       }
+                       break;
                }
-               self = oldself;
-               other = oldother;
        }
+       self = oldself;
+       other = oldother;
 }
 
 .float warpzone_reconnecting;