Make sure handleAllVotes returns true at least once

This commit is contained in:
kimden 2024-04-02 01:00:32 +04:00
parent c520c441d3
commit 31bdb52bfd

View File

@ -4362,13 +4362,14 @@ bool ServerLobby::handleAllVotes(PeerVote* winner_vote,
Log::warn("ServerLobby", Log::warn("ServerLobby",
"Missing track %s from majority.", top_track.c_str()); "Missing track %s from majority.", top_track.c_str());
it = m_peers_votes.begin(); it = m_peers_votes.begin();
return false; if (!isVotingOver())
return false;
} }
*winner_peer_id = it->first; *winner_peer_id = it->first;
*winner_vote = it->second; *winner_vote = it->second;
return true; return true;
} }
else if (isVotingOver()) if (isVotingOver())
{ {
// Pick the best lap (or soccer goal / time) from only the top track // Pick the best lap (or soccer goal / time) from only the top track
// if no majority agreement from all // if no majority agreement from all