Ticket #4120: fix_gamesetup_v1.patch
File fix_gamesetup_v1.patch, 1.0 KB (added by , 8 years ago) |
---|
-
binaries/data/mods/public/gui/gamesetup/gamesetup.js
function onTick() 1044 1044 * Called when the map or the number of players changes. 1045 1045 */ 1046 1046 function resizePlayerData(targetPlayerData, maxPlayers) 1047 1047 { 1048 1048 if (g_IsNetworked) 1049 // Unassign excess players 1050 for (let guid in g_PlayerAssignments) 1051 { 1052 let playerID = g_PlayerAssignments[guid].player; 1053 if (playerID > maxPlayers) 1054 Engine.AssignNetworkPlayer(playerID, ""); 1055 } 1049 { 1050 // Remove invalid playerIDs from the servers playerassignments copy 1051 for (let playerID = +maxPlayers + 1; playerID <= g_MaxPlayers; ++playerID) 1052 Engine.AssignNetworkPlayer(playerID, ""); 1053 } 1056 1054 else if (!g_PlayerAssignments.local || 1057 1055 g_PlayerAssignments.local.player > maxPlayers) 1058 1056 g_PlayerAssignments = { 1059 1057 "local": { 1060 1058 "name": singleplayerName(),