diff options
| author | oy <Tom_Adams@web.de> | 2011-01-03 12:50:38 +0100 |
|---|---|---|
| committer | oy <Tom_Adams@web.de> | 2011-01-03 12:50:38 +0100 |
| commit | a72848e78032014adb1bf053c4556bf1072b0c2d (patch) | |
| tree | 5a9da24803f3432c79229b87abe77b6235668e19 /src/game/server/gamecontext.cpp | |
| parent | b29b6d0bcff3d22fe5dac3453689fb8d315cf3ee (diff) | |
| download | zcatch-a72848e78032014adb1bf053c4556bf1072b0c2d.tar.gz zcatch-a72848e78032014adb1bf053c4556bf1072b0c2d.zip | |
added constants for teams by Choupom
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(); |