Ticket #4078: all_ai_in_sp.patch

File all_ai_in_sp.patch, 2.4 KB (added by ixly, 8 years ago)

Do not forcefully reassign players and remove the check requiring at least one human player to start

  • binaries/data/mods/public/gui/credits/texts/programming.json

     
    9292            {"nick": "infyquest", "name": "Vijay Kiran Kamuju"},
    9393            {"nick": "IronNerd", "name": "Matthew McMullan"},
    9494            {"nick": "Itms", "name": "Nicolas Auvray"},
     95            {"nick": "ixly"},
    9596            {"nick": "Jaison", "name": "Marco tom Suden"},
    9697            {"nick": "jammus", "name": "James Scott"},
    9798            {"nick": "Jgwman"},
  • binaries/data/mods/public/gui/gamesetup/gamesetup.js

     
    16011601            ++assignedCount;
    16021602    }
    16031603
    1604     // Only enable start button if we have enough assigned players
     1604    // Only enable start button if we are the controller
    16051605    if (g_IsController)
    1606         Engine.GetGUIObjectByName("startGame").enabled = assignedCount > 0;
     1606        Engine.GetGUIObjectByName("startGame").enabled = true;
    16071607
    16081608    for (let ai of g_Settings.AIDescriptions)
    16091609    {
     
    16831683                    return;
    16841684
    16851685                let guid = hostGuidList[this.selected];
    1686                 if (!guid)
     1686
     1687                if (!guid || guid.substr(0, 3) == "ai:")
    16871688                {
     1689                    // Unassign any host from this player slot
    16881690                    if (g_IsNetworked)
    1689                         // Unassign any host from this player slot
    16901691                        Engine.AssignNetworkPlayer(playerID, "");
    1691                     // Remove AI from this player slot
    1692                     g_GameAttributes.settings.PlayerData[playerSlot].AI = "";
     1692
     1693                    // If a human was removed from the slot, make sure they are not reassigned
     1694                    let changeTarget = this.list_data[selection];
     1695                    if(g_PlayerAssignments[changeTarget])
     1696                        g_PlayerAssignments[changeTarget].player = -1;
     1697
     1698                    // Set the AI, unless we are unassigning
     1699                    g_GameAttributes.settings.PlayerData[playerSlot].AI = guid ? guid.substr(3) : "";
    16931700                }
    1694                 else if (guid.substr(0, 3) == "ai:")
    1695                 {
    1696                     if (g_IsNetworked)
    1697                         // Unassign any host from this player slot
    1698                         Engine.AssignNetworkPlayer(playerID, "");
    1699                     // Set the AI for this player slot
    1700                     g_GameAttributes.settings.PlayerData[playerSlot].AI = guid.substr(3);
    1701                 }
    17021701                else
    17031702                    swapPlayers(guid, playerSlot);
    17041703