diff options
Diffstat (limited to 'src/game/server/gamecontext.cpp')
| -rw-r--r-- | src/game/server/gamecontext.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/game/server/gamecontext.cpp b/src/game/server/gamecontext.cpp index 5834d074..4f494f75 100644 --- a/src/game/server/gamecontext.cpp +++ b/src/game/server/gamecontext.cpp @@ -414,7 +414,7 @@ void CGameContext::OnTick() bool aVoteChecked[MAX_CLIENTS] = {0}; for(int i = 0; i < MAX_CLIENTS; i++) { - if(!m_apPlayers[i] || m_apPlayers[i]->GetTeam() == -1 || aVoteChecked[i]) // don't count in votes by spectators + if(!m_apPlayers[i] || m_apPlayers[i]->GetTeam() == TEAM_SPECTATORS || aVoteChecked[i]) // don't count in votes by spectators continue; int ActVote = m_apPlayers[i]->m_Vote; @@ -513,7 +513,7 @@ void CGameContext::OnClientEnter(int ClientId) void CGameContext::OnClientConnected(int ClientId) { // Check which team the player should be on - const int StartTeam = g_Config.m_SvTournamentMode ? -1 : m_pController->GetAutoTeam(ClientId); + const int StartTeam = g_Config.m_SvTournamentMode ? TEAM_SPECTATORS : m_pController->GetAutoTeam(ClientId); m_apPlayers[ClientId] = new(ClientId) CPlayer(this, ClientId, StartTeam); //players[client_id].init(client_id); @@ -595,7 +595,7 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId) int64 Now = Server()->Tick(); p->m_Last_VoteTry = Now; - if(p->GetTeam() == -1) + if(p->GetTeam() == TEAM_SPECTATORS) { SendChatTarget(ClientId, "Spectators aren't allowed to start a vote."); return; @@ -732,7 +732,7 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId) if(m_pController->CanChangeTeam(p, pMsg->m_Team)) { p->m_Last_SetTeam = Server()->Tick(); - if(p->GetTeam() == -1 || pMsg->m_Team == -1) + if(p->GetTeam() == TEAM_SPECTATORS || pMsg->m_Team == TEAM_SPECTATORS) m_VoteUpdate = true; p->SetTeam(pMsg->m_Team); (void)m_pController->CheckTeamBalance(); |