From 7efbf0633e0e0d38d1841f47169dbaf54eb23e83 Mon Sep 17 00:00:00 2001 From: deniz1a Date: Sun, 26 Jul 2015 03:25:43 +0300 Subject: [PATCH] Changes shroud lobby setting from disabling shroud to revealing it. --- OpenRA.Game/Traits/World/Shroud.cs | 2 +- OpenRA.Game/World.cs | 4 ++++ OpenRA.Mods.Common/Traits/RevealsShroud.cs | 4 +--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/OpenRA.Game/Traits/World/Shroud.cs b/OpenRA.Game/Traits/World/Shroud.cs index d9517f08ec..01e75e5e09 100644 --- a/OpenRA.Game/Traits/World/Shroud.cs +++ b/OpenRA.Game/Traits/World/Shroud.cs @@ -282,7 +282,7 @@ namespace OpenRA.Traits return explored.Contains(uv) && explored[uv] && (generatedShroudCount[uv] == 0 || visibleCount[uv] > 0); } - public bool ShroudEnabled { get { return !Disabled && self.World.LobbyInfo.GlobalSettings.Shroud; } } + public bool ShroudEnabled { get { return !Disabled; } } /// /// Returns a fast exploration lookup that skips the usual validation. diff --git a/OpenRA.Game/World.cs b/OpenRA.Game/World.cs index 94ce263507..be8fbd8a99 100644 --- a/OpenRA.Game/World.cs +++ b/OpenRA.Game/World.cs @@ -180,6 +180,10 @@ namespace OpenRA MapUid = Map.Uid, MapTitle = Map.Title }; + + if (!LobbyInfo.GlobalSettings.Shroud) + foreach (var player in Players) + player.Shroud.ExploreAll(this); } public void LoadComplete(WorldRenderer wr) diff --git a/OpenRA.Mods.Common/Traits/RevealsShroud.cs b/OpenRA.Mods.Common/Traits/RevealsShroud.cs index 535e710ff2..c7aba8b796 100644 --- a/OpenRA.Mods.Common/Traits/RevealsShroud.cs +++ b/OpenRA.Mods.Common/Traits/RevealsShroud.cs @@ -30,7 +30,6 @@ namespace OpenRA.Mods.Common.Traits static readonly PPos[] NoCells = { }; readonly RevealsShroudInfo info; - readonly bool lobbyShroudFogDisabled; [Sync] CPos cachedLocation; [Sync] bool cachedDisabled; @@ -41,7 +40,6 @@ namespace OpenRA.Mods.Common.Traits public RevealsShroud(Actor self, RevealsShroudInfo info) { this.info = info; - lobbyShroudFogDisabled = !self.World.LobbyInfo.GlobalSettings.Shroud && !self.World.LobbyInfo.GlobalSettings.Fog; addCellsToPlayerShroud = (p, uv) => p.Shroud.AddProjectedVisibility(self, uv); removeCellsFromPlayerShroud = p => p.Shroud.RemoveVisibility(self); @@ -66,7 +64,7 @@ namespace OpenRA.Mods.Common.Traits public void Tick(Actor self) { - if (lobbyShroudFogDisabled || !self.IsInWorld) + if (!self.IsInWorld) return; var centerPosition = self.CenterPosition;