Disallow spectators to participate in kick votes

Fixes #186
This commit is contained in:
def 2015-04-19 14:15:50 +02:00
parent d690877117
commit 14b5766b30

View file

@ -629,9 +629,9 @@ void CGameContext::OnTick()
aVoteChecked[i]) // don't count in votes by spectators if the admin doesn't want it
continue;
if(m_VoteKick &&
GetPlayerChar(m_VoteCreator) && GetPlayerChar(i) &&
GetPlayerChar(m_VoteCreator)->Team() != GetPlayerChar(i)->Team())
if(m_VoteKick && ((!m_apPlayers[i] || m_apPlayers[i]->GetTeam() == TEAM_SPECTATORS) ||
(GetPlayerChar(m_VoteCreator) && GetPlayerChar(i) &&
GetPlayerChar(m_VoteCreator)->Team() != GetPlayerChar(i)->Team())))
continue;
if (m_apPlayers[i]->m_Afk)