]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/spawnpoints.qc
Port zoomstate and spectatee_status to ClientState
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / spawnpoints.qc
index 84819efbe1c6b51f407c9e9e9b509dcd82aab441..bdb9cdab787a8c4f19f26ff222930b5368bbbdc8 100644 (file)
@@ -64,7 +64,7 @@ void spawnpoint_use(entity this, entity actor, entity trigger)
        if(have_team_spawns > 0)
        {
                this.team = actor.team;
-               some_spawn_has_been_used = 1;
+               some_spawn_has_been_used = true;
        }
        //LOG_INFO("spawnpoint was used!\n");
 }
@@ -106,13 +106,14 @@ void relocate_spawnpoint(entity this)
     setthink(this, spawnpoint_think);
     this.nextthink = time + 0.5 + random() * 2; // shouldn't need it for a little second
     this.team_saved = this.team;
+    IL_PUSH(g_saved_team, this);
     if (!this.cnt)
         this.cnt = 1;
 
     if (have_team_spawns != 0)
         if (this.team)
             have_team_spawns = 1;
-    have_team_spawns_forteam[this.team] = 1;
+    have_team_spawns_forteams |= BIT(this.team);
 
     if (autocvar_r_showbboxes)
     {
@@ -343,11 +344,11 @@ entity SelectSpawnPoint(entity this, bool anypoint)
                teamcheck = -1;
        else if(have_team_spawns > 0)
        {
-               if(have_team_spawns_forteam[this.team] == 0)
+               if(!(have_team_spawns_forteams & BIT(this.team)))
                {
                        // we request a spawn for a team, and we have team
                        // spawns, but that team has no spawns?
-                       if(have_team_spawns_forteam[0])
+                       if(have_team_spawns_forteams & BIT(0))
                                // try noteam spawns
                                teamcheck = 0;
                        else
@@ -357,7 +358,7 @@ entity SelectSpawnPoint(entity this, bool anypoint)
                else
                        teamcheck = this.team; // MUST be team
        }
-       else if(have_team_spawns == 0 && have_team_spawns_forteam[0])
+       else if(have_team_spawns == 0 && (have_team_spawns_forteams & BIT(0)))
                teamcheck = 0; // MUST be noteam
        else
                teamcheck = -1;