Prevent players from rejoining that were not present on game start. Patch by elexis. Fixes #3305.

This was SVN commit r16792.
This commit is contained in:
leper 2015-06-18 18:20:54 +00:00
parent 9701a85554
commit c6ca83949c

View File

@ -1044,6 +1044,14 @@ void CNetServerWorker::StartGame()
// Send the final setup state to all clients
UpdateGameAttributes(&m_GameAttributes.get());
// Remove players and observers that are not present when the game starts
for (PlayerAssignmentMap::iterator it = m_PlayerAssignments.begin(); it != m_PlayerAssignments.end();)
if (it->second.m_Enabled)
++it;
else
it = m_PlayerAssignments.erase(it);
SendPlayerAssignments();
CGameStartMessage gameStart;