| 882 | // Find which settings can be changed by the user |
| 883 | let allowedSettings = ["PlayerData"]; |
| 884 | |
| 885 | if (attrs.mapType == "skirmish" || attrs.mapType == "random") |
| 886 | allowedSettings = allowedSettings.concat( |
| 887 | [ |
| 888 | "GameType", |
| 889 | "WonderDuration", |
| 890 | "PopulationCap", |
| 891 | "Ceasefire", |
| 892 | "StartingResources", |
| 893 | "RevealMap", |
| 894 | "LockTeams", |
| 895 | "ExploreMap", |
| 896 | "DisableTreasures" |
| 897 | ]); |
| 898 | |
| 899 | if (attrs.mapType == "random") |
| 900 | allowedSettings.push("Size"); |
| 901 | |
| 902 | if (g_IsNetworked) |
| 903 | allowedSettings.push("CheatsEnabled"); |
| 904 | |
| 905 | if (Engine.HasXmppClient()) |
| 906 | allowedSettings.push("RatingEnabled"); |
| 907 | |
| 908 | // Only load settings which can be changed by the user |
| 909 | for (let prop in attrs.settings) |
| 910 | if (!(prop in allowedSettings)) |
| 911 | delete attrs.settings[prop]; |
| 912 | |
| 913 | if (attrs.settings.RatingEnabled) |
| 914 | attrs.settings.CheatsEnabled = false; |
| 915 | |
| 916 | // Restore valid matchsettings |