Index: ps/trunk/binaries/data/mods/public/gui/gamesettings/attributes/MapExploration.js =================================================================== --- ps/trunk/binaries/data/mods/public/gui/gamesettings/attributes/MapExploration.js (revision 26150) +++ ps/trunk/binaries/data/mods/public/gui/gamesettings/attributes/MapExploration.js (revision 26151) @@ -1,53 +1,62 @@ GameSettings.prototype.Attributes.MapExploration = class MapExploration extends GameSetting { init() { + this.resetAll(); + this.settings.map.watch(() => this.onMapChange(), ["map"]); + } + + resetAll() + { this.explored = false; this.revealed = false; this.allied = false; - - this.settings.map.watch(() => this.onMapChange(), ["map"]); } toInitAttributes(attribs) { attribs.settings.RevealMap = this.revealed; attribs.settings.ExploreMap = this.explored; attribs.settings.AllyView = this.allied; } fromInitAttributes(attribs) { this.explored = !!this.getLegacySetting(attribs, "ExploreMap"); this.revealed = !!this.getLegacySetting(attribs, "RevealMap"); this.allied = !!this.getLegacySetting(attribs, "AllyView"); } onMapChange(mapData) { if (this.settings.map.type != "scenario") return; + this.resetAll(); this.setExplored(this.getMapSetting("ExploreMap")); this.setRevealed(this.getMapSetting("RevealMap")); this.setAllied(this.getMapSetting("AllyView")); } setExplored(enabled) { + if (enabled === undefined) + return; this.explored = enabled; this.revealed = this.revealed && this.explored; } setRevealed(enabled) { - this.explored = this.explored || enabled; + if (enabled === undefined) + return; this.revealed = enabled; - this.allied = this.allied || enabled; + this.explored = this.explored || this.revealed; } setAllied(enabled) { + if (enabled === undefined) + return; this.allied = enabled; - this.revealed = this.revealed && this.allied; } };