{
Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_MOVETOSPEC_IDLING, this.netname, maxidle_time);
PutObserverInServer(this, true, true);
+ if(autocvar_g_balance_teams_remove)
+ TeamBalance_RemoveExcessPlayers(this);
}
else
{
if (this.wants_join)
SetPlayerTeam(this, -1, TEAM_CHANGE_SPECTATOR);
else
+ {
PutObserverInServer(this, false, true);
+ if(autocvar_g_balance_teams_remove)
+ TeamBalance_RemoveExcessPlayers(this);
+ }
}
else
{
else if (!CS(player).just_joined && player.frags != FRAGS_SPECTATOR)
{
Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_QUIT_SPECTATE, player.netname);
- if(autocvar_g_balance_teams_remove)
- TeamBalance_RemoveExcessPlayers(player);
}
}
for(int i = 1; i <= AVAILABLE_TEAMS; ++i)
{
int cur = TeamBalance_GetTeamFromIndex(balance, i).m_num_players;
- if(cur < min)
+ if(i == 1 || cur < min)
min = cur;
}