mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-09-21 20:06:40 +00:00
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:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user