Ticket #4078: all_ai_in_sp_v2.patch

File all_ai_in_sp_v2.patch, 3.2 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

     
    15841584    let assignments = [];
    15851585    let aiAssignments = {};
    15861586    let noAssignment;
    1587     let assignedCount = 0;
     1587
    15881588    for (let guid of sortGUIDsByPlayerID())
    15891589    {
    15901590        let player = g_PlayerAssignments[guid].player;
     
    15961596
    15971597        hostGuidList.push(guid);
    15981598        assignments[player] = hostNameList.length-1;
    1599 
    1600         if (player != -1)
    1601             ++assignedCount;
    16021599    }
    16031600
    1604     // Only enable start button if we have enough assigned players
    1605     if (g_IsController)
    1606         Engine.GetGUIObjectByName("startGame").enabled = assignedCount > 0;
    1607 
    16081601    for (let ai of g_Settings.AIDescriptions)
    16091602    {
    16101603        // If the map uses a hidden AI then don't hide it
     
    16831676                    return;
    16841677
    16851678                let guid = hostGuidList[this.selected];
    1686                 if (!guid)
     1679
     1680                if (!guid || guid.substr(0, 3) == "ai:")
    16871681                {
     1682                    // Unassign any host from this player slot
    16881683                    if (g_IsNetworked)
    1689                         // Unassign any host from this player slot
    16901684                        Engine.AssignNetworkPlayer(playerID, "");
    1691                     // Remove AI from this player slot
    1692                     g_GameAttributes.settings.PlayerData[playerSlot].AI = "";
     1685
     1686                    // If a human was removed from the slot, make sure they are not reassigned
     1687                    let changeTarget = this.list_data[selection];
     1688                    if (g_PlayerAssignments[changeTarget])
     1689                        g_PlayerAssignments[changeTarget].player = -1;
     1690
     1691                    // Set the AI, unless we are unassigning
     1692                    g_GameAttributes.settings.PlayerData[playerSlot].AI = guid ? guid.substr(3) : "";
    16931693                }
    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                 }
    17021694                else
    17031695                    swapPlayers(guid, playerSlot);
    17041696
  • binaries/data/mods/public/gui/gamesetup/gamesetup.xml

     
    256256                style="StoneButton"
    257257                size="100%-164 100%-52 100%-24 100%-24"
    258258                tooltip_style="onscreenToolTip"
    259                 enabled="false"
     259                enabled="true"
    260260            >
    261261                <translatableAttribute id="caption">Start game!</translatableAttribute>
    262262                <translatableAttribute id="tooltip">Start a new game with the current settings.</translatableAttribute>