mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 22:48:18 +00:00
Fix votes
This commit is contained in:
parent
00d86444b5
commit
311e89c79d
|
@ -8,6 +8,7 @@
|
|||
#include <engine/map.h>
|
||||
#include <engine/console.h>
|
||||
#include <engine/engine.h>
|
||||
#include <engine/server/server.h>
|
||||
#include <engine/shared/datafile.h>
|
||||
#include <engine/shared/linereader.h>
|
||||
#include <engine/storage.h>
|
||||
|
@ -734,7 +735,7 @@ void CGameContext::OnTick()
|
|||
aVoteChecked[i]) // don't count in votes by spectators if the admin doesn't want it
|
||||
continue;
|
||||
|
||||
if((m_VoteKick || m_VoteSpec) && ((!m_apPlayers[i] || m_apPlayers[i]->GetTeam() == TEAM_SPECTATORS) ||
|
||||
if((m_VoteKick || m_VoteSpec) && (m_apPlayers[i]->GetTeam() == TEAM_SPECTATORS ||
|
||||
(GetPlayerChar(m_VoteCreator) && GetPlayerChar(i) &&
|
||||
GetPlayerChar(m_VoteCreator)->Team() != GetPlayerChar(i)->Team())))
|
||||
continue;
|
||||
|
@ -742,6 +743,10 @@ void CGameContext::OnTick()
|
|||
if(m_apPlayers[i]->m_Afk && i != m_VoteCreator)
|
||||
continue;
|
||||
|
||||
// connecting clients with spoofed ips can clog slots without being ingame
|
||||
if(((CServer*)Server())->m_aClients[i].m_State != CServer::CClient::STATE_INGAME)
|
||||
continue;
|
||||
|
||||
// don't count votes by blacklisted clients
|
||||
if(g_Config.m_SvDnsblVote && !m_pServer->DnsblWhite(i))
|
||||
continue;
|
||||
|
|
Loading…
Reference in a new issue