Fixed clients being able to vote for kicking multiple times by disconnecting and reconnecting

This commit is contained in:
Regalis
2017-04-18 19:46:57 +03:00
parent 67a3020430
commit f407a38c9e
2 changed files with 9 additions and 6 deletions

View File

@@ -1774,8 +1774,9 @@ namespace Barotrauma.Networking
public void UpdateVoteStatus()
{
if (server.Connections.Count == 0) return;
if (connectedClients.Count == 0) return;
if (server.Connections.Count == 0|| connectedClients.Count == 0) return;
Client.UpdateKickVotes(connectedClients);
var clientsToKick = connectedClients.FindAll(c => c.KickVoteCount >= connectedClients.Count * KickVoteRequiredRatio);
foreach (Client c in clientsToKick)