Fix critical gamesetup bug again where the game can't be started after a previously assigned disconnected client rejoins a full game. Same as #3602, reintroduced by b642f0d876, refs #3120. Fixes #4120.

This was SVN commit r18702.
This commit is contained in:
elexis
2016-09-05 02:15:04 +00:00
parent 565709701e
commit c056b9bfb9
@@ -1071,13 +1071,11 @@ function onTick()
function resizePlayerData(targetPlayerData, maxPlayers)
{
if (g_IsNetworked)
// Unassign excess players
for (let guid in g_PlayerAssignments)
{
let playerID = g_PlayerAssignments[guid].player;
if (playerID > maxPlayers)
Engine.AssignNetworkPlayer(playerID, "");
}
{
// Remove invalid playerIDs from the servers playerassignments copy
for (let playerID = +maxPlayers + 1; playerID <= g_MaxPlayers; ++playerID)
Engine.AssignNetworkPlayer(playerID, "");
}
else if (!g_PlayerAssignments.local ||
g_PlayerAssignments.local.player > maxPlayers)
g_PlayerAssignments = {