diff --git a/binaries/data/mods/public/gui/gamesetup/gamesetup.js b/binaries/data/mods/public/gui/gamesetup/gamesetup.js
index bebe043..4830592 100644
a
|
b
|
function sanitizePlayerData(playerData)
|
995 | 995 | playerData.forEach((pData, index) => { |
996 | 996 | pData.Color = pData.Color || g_PlayerColors[index]; |
997 | 997 | pData.Civ = pData.Civ || "random"; |
998 | | pData.AI = pData.AI || ""; |
| 998 | |
| 999 | // Use default AI if the map doesn't specify any explicitly |
| 1000 | if (!("AI" in pData)) |
| 1001 | pData.AI = g_DefaultPlayerData[index].AI; |
| 1002 | |
| 1003 | if (!("AIDiff" in pData)) |
| 1004 | pData.AIDiff = g_DefaultPlayerData[index].AIDiff; |
999 | 1005 | }); |
1000 | 1006 | |
1001 | 1007 | // Replace colors with the best matching color of PlayerDefaults |
… |
… |
function selectMap(name)
|
1229 | 1235 | for (let prop in mapSettings) |
1230 | 1236 | g_GameAttributes.settings[prop] = mapSettings[prop]; |
1231 | 1237 | |
1232 | | // Use default AI if the map doesn't specify any explicitly |
1233 | | for (let i in g_GameAttributes.settings.PlayerData) |
1234 | | { |
1235 | | if (!('AI' in g_GameAttributes.settings.PlayerData[i])) |
1236 | | g_GameAttributes.settings.PlayerData[i].AI = g_DefaultPlayerData[i].AI; |
1237 | | if (!('AIDiff' in g_GameAttributes.settings.PlayerData[i])) |
1238 | | g_GameAttributes.settings.PlayerData[i].AIDiff = g_DefaultPlayerData[i].AIDiff; |
1239 | | } |
1240 | | |
1241 | 1238 | updateGameAttributes(); |
1242 | 1239 | } |
1243 | 1240 | |