FOR_EACH_REALCLIENT(head)
{
- if(head.classname == "player" || g_lms || g_arena || g_ca)
+ if(head.classname == "player" || g_lms || g_arena || head.caplayer == 1)
++activerealplayers;
++realplayers;
}
return;
} else {
- if (g_ca && self.caplayer) {
- } // do nothing
- else
+ if(!self.caplayer)
stuffcmd(self,"menu_showteamselect\n");
return;
}
return maxclients - totalClients;
float currentlyPlaying = 0;
- FOR_EACH_REALPLAYER(e)
- currentlyPlaying += 1;
+ FOR_EACH_REALCLIENT(e)
+ if(e.classname == "player" || e.caplayer == 1)
+ currentlyPlaying += 1;
if(currentlyPlaying < autocvar_g_maxplayers)
return min(maxclients - totalClients, autocvar_g_maxplayers - currentlyPlaying);
if(self.classname == "player" && autocvar_sv_spectate == 1)
ClientKill_TeamChange(-2); // observe
-
+
// in CA, allow a dead player to move to spectators (without that, caplayer!=0 will be moved back to the player list)
// note: if arena game mode is ever done properly, this needs to be removed.
- if(g_ca && self.caplayer && (self.classname == "spectator" || self.classname == "observer"))
+ if(self.caplayer && (self.classname == "spectator" || self.classname == "observer"))
{
sprint(self, "WARNING: you will spectate in the next round.\n");
self.caplayer = 0;
inWarmupStage = 0; // once the game is restarted the game is in match stage
// reset the .ready status of all players (also spectators)
- FOR_EACH_CLIENTSLOT(tmp_player) { tmp_player.ready = 0; }
+ FOR_EACH_REALCLIENT(tmp_player) { tmp_player.ready = 0; }
readycount = 0;
Nagger_ReadyCounted(); // NOTE: this causes a resend of that entity, and will also turn off warmup state on the client
float ready_needed_factor, ready_needed_count;
float t_ready = 0, t_players = 0;
- FOR_EACH_REALPLAYER(tmp_player)
+ FOR_EACH_REALCLIENT(tmp_player)
{
- ++t_players;
- if(tmp_player.ready) { ++t_ready; }
+ if(tmp_player.classname == "player" || tmp_player.caplayer == 1)
+ {
+ ++t_players;
+ if(tmp_player.ready) { ++t_ready; }
+ }
}
readycount = t_ready;
{
s = strcat(":player:see-labels:", GetPlayerScoreString(other, 0), ":");
s = strcat(s, ftos(rint(time - other.jointime)), ":");
- if(other.classname == "player" || g_arena || g_ca || g_lms)
+ if(other.classname == "player" || g_arena || other.caplayer == 1 || g_lms)
s = strcat(s, ftos(other.team), ":");
else
s = strcat(s, "spectator:");
s = strcat(s, ":human");
else
s = strcat(s, ":bot");
- if(p.classname != "player" && !g_arena && !g_ca && !g_lms)
+ if(p.classname != "player" && !g_arena && p.caplayer != 1 && !g_lms)
s = strcat(s, ":spectator");
}
else
{
- if(p.classname == "player" || g_arena || g_ca || g_lms)
+ if(p.classname == "player" || g_arena || p.caplayer == 1 || g_lms)
s = GetPlayerScoreString(p, 2);
else
s = "-666";