]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/spawnpoints.qc
Various fixes for spawnpoint effects
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / spawnpoints.qc
index 7d402ad838578300ac8e47fd2e1f628086615d3a..429bf84947e39fb0c652dabfff4e35c06f89f64b 100644 (file)
@@ -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)