From 4cfd0d64fbf92dee472b765aa892c8e879e448e1 Mon Sep 17 00:00:00 2001 From: elexis Date: Sat, 30 Apr 2016 12:14:08 +0000 Subject: [PATCH] Only show the AI-difficulty button if there is an AI assigned to that playerslot. Patch by Imarok, fixes #3942. This was SVN commit r18110. --- .../data/mods/public/gui/gamesetup/gamesetup.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/binaries/data/mods/public/gui/gamesetup/gamesetup.js b/binaries/data/mods/public/gui/gamesetup/gamesetup.js index fbf47d5459..db1ca01b0b 100644 --- a/binaries/data/mods/public/gui/gamesetup/gamesetup.js +++ b/binaries/data/mods/public/gui/gamesetup/gamesetup.js @@ -1591,7 +1591,14 @@ function updatePlayerList() { // Check for a valid AI if (aiId in aiAssignments) + { selection = aiAssignments[aiId]; + configButton.hidden = false; + configButton.onpress = function() + { + openAIConfig(playerSlot); + }; + } else { g_GameAttributes.settings.PlayerData[playerSlot].AI = ""; @@ -1601,12 +1608,6 @@ function updatePlayerList() if (!selection) selection = noAssignment; - - // Since no human is assigned, show the AI config button - configButton.hidden = false; - configButton.onpress = function() { - openAIConfig(playerSlot); - }; } // There was a human, so make sure we don't have any AI left // over in their slot, if we're in charge of the attributes