]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/spawnpoints.qc
Merge branch 'master' into terencehill/itemstime
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / spawnpoints.qc
index 7d402ad838578300ac8e47fd2e1f628086615d3a..3f4e72c3b3f584b67c0cc4de06f9f033d568f6db 100644 (file)
@@ -13,7 +13,7 @@ float SpawnPoint_Send(entity to, float sf)
 float SpawnEvent_Send(entity to, float sf)
 {
        float send;
-       
+
        WriteByte(MSG_ENTITY, ENT_CLIENT_SPAWNEVENT);
 
        if(autocvar_g_spawn_alloweffects)
@@ -100,7 +100,34 @@ void relocate_spawnpoint()
         e.solid = SOLID_TRIGGER;
     }
 
-    Net_LinkEntity(self, FALSE, 0, SpawnPoint_Send);
+       // Don't show team spawns in non-team matches,
+       // and don't show non-team spawns in team matches.
+       // (Unless useallspawns is activated)
+       if(
+               !(
+                       ( // if this passes, there is a DM spawn on a team match
+                               teamplay
+                               && (self.team != NUM_TEAM_1)
+                               && (self.team != NUM_TEAM_2)
+                               && (self.team != NUM_TEAM_3)
+                               && (self.team != NUM_TEAM_4)
+                       )
+                       ||
+                       ( // if this passes, there is a team spawn on a DM match
+                               !teamplay
+                               &&
+                               (
+                                       (self.team == NUM_TEAM_1)
+                                       || (self.team == NUM_TEAM_2)
+                                       || (self.team == NUM_TEAM_3)
+                                       || (self.team == NUM_TEAM_4)
+                               )
+                       )
+               )
+               ||
+               autocvar_g_spawn_useallspawns
+       )
+       { Net_LinkEntity(self, FALSE, 0, SpawnPoint_Send); }
 }
 
 void spawnfunc_info_player_survivor (void)
@@ -291,12 +318,7 @@ entity SelectSpawnPoint (float anypoint)
        }
        else
        {
-               float mindist;
-               if(g_arena && arena_roundbased)
-                       mindist = 800;
-               else
-                       mindist = 100;
-               firstspot = Spawn_FilterOutBadSpots(firstspot, mindist, teamcheck);
+               firstspot = Spawn_FilterOutBadSpots(firstspot, 100, teamcheck);
 
                // there is 50/50 chance of choosing a random spot or the furthest spot
                // (this means that roughly every other spawn will be furthest, so you