| 875 | // Find which settings can be changed by the user |
| 876 | let allowedSettings = ["PlayerData", "RatingEnabled"]; |
| 877 | |
| 878 | if (attrs.mapType == "skirmish" || attrs.mapType == "random") |
| 879 | allowedSettings = allowedSettings.concat( |
| 880 | [ |
| 881 | "GameType", |
| 882 | "VictoryScripts", |
| 883 | "WonderDuration", |
| 884 | "PopulationCap", |
| 885 | "Ceasefire", |
| 886 | "StartingResources", |
| 887 | "RevealMap", |
| 888 | "LockTeams", |
| 889 | "ExploreMap", |
| 890 | "DisableTreasures" |
| 891 | ]); |
| 892 | |
| 893 | if (attrs.mapType == "random") |
| 894 | allowedSettings = allowedSettings.push("Size"); |
| 895 | |
| 896 | if (g_IsNetworked) |
| 897 | allowedSettings.push("CheatsEnabled"); |
| 898 | |
| 899 | // Only load settings which can be changed by the user |
| 900 | for (let prop in attrs.settings) |
| 901 | if (!(prop in allowedSettings)) |
| 902 | delete attrs.settings[prop]; |
| 903 | |
| 904 | // Restore valid matchsettings |