]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
when trying to spawn, and your team has no spawns on the map, BUT other teams do...
authorRudolf Polzer <divverent@alientrap.org>
Sat, 23 Apr 2011 18:05:04 +0000 (20:05 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Sat, 23 Apr 2011 18:05:04 +0000 (20:05 +0200)
qcsrc/server/cl_client.qc
qcsrc/server/defs.qh
qcsrc/server/miscfunctions.qc

index 4f92644667b0224c8f5e3a9763bca8727d5c8ad8..9e704b882486ad3cdadb5eb2c2834c282f2e8a7c 100644 (file)
@@ -328,13 +328,28 @@ entity SelectSpawnPoint (float anypoint)
        if(anypoint)
                teamcheck = -1;
        else if(have_team_spawns > 0)
-               teamcheck = self.team; // MUST be team
-       else if(have_team_spawns == 0 && have_noteam_spawns)
+       {
+               if(have_team_spawns_forteam[self.team] == 0)
+               {
+                       // we request a spawn for a team, and we have team
+                       // spawns, but that team has no spawns?
+                       if(have_team_spawns[0])
+                               // try noteam spawns
+                               teamcheck = 0;
+                       else
+                               // if not, any spawn has to do
+                               teamcheck = -1;
+               }
+               else
+                       teamcheck = self.team; // MUST be team
+       }
+       else if(have_team_spawns == 0 && have_team_spawns[0])
                teamcheck = 0; // MUST be noteam
        else
                teamcheck = -1;
                // if we get here, we either require team spawns but have none, or we require non-team spawns and have none; use any spawn then
 
+
        // get the list of players
        playerlist = findchain(classname, "player");
        // get the entire list of spots
index d7179fafebb703f9c8b2d38ebd426d25cb2a3014..cf13fee2c67cc944407e4921e3ee79af2f225cc8 100644 (file)
@@ -410,7 +410,7 @@ float TemporaryDB;
 
 float some_spawn_has_been_used;
 float have_team_spawns; // 0 = no team spawns requested, -1 = team spawns requested but none found, 1 = team spawns requested and found
-float have_noteam_spawns; // 0 = no no-team spawns, 1 = no-team spawns exist
+float have_team_spawns_forteam[17]; // 0 = this team has no spawns, 1 = this team has spawns; team 0 is the "no-team"
 
 // set when showing a kill countdown
 .entity killindicator;
index 84dd07d94a185f3c065296f49cc3e2af6b79a017..0c8162b54464275c9df9537dd1aad11d4f9af682 100644 (file)
@@ -236,8 +236,7 @@ void relocate_spawnpoint()
     if (have_team_spawns != 0)
         if (self.team)
             have_team_spawns = 1;
-    if (!self.team)
-        have_noteam_spawns = 1;
+    have_team_spawns_forteam[self.team] = 1;
 
     if (autocvar_r_showbboxes)
     {