diff --git a/OpenRA.Mods.Common/Traits/Buildings/FootprintUtils.cs b/OpenRA.Mods.Common/Traits/Buildings/FootprintUtils.cs index defa93a0bf..f2467eb682 100644 --- a/OpenRA.Mods.Common/Traits/Buildings/FootprintUtils.cs +++ b/OpenRA.Mods.Common/Traits/Buildings/FootprintUtils.cs @@ -17,7 +17,7 @@ namespace OpenRA.Mods.Common.Traits { public static class FootprintUtils { - public static IEnumerable Tiles(Ruleset rules, string name, BuildingInfo buildingInfo, CPos topLeft) + public static IEnumerable Tiles(Ruleset rules, string name, BuildingInfo buildingInfo, CPos topLeft, bool includePassable = false) { var dim = buildingInfo.Dimensions; @@ -30,7 +30,7 @@ namespace OpenRA.Mods.Common.Traits footprint = footprint.Concat(new char[dim.X]); } - return TilesWhere(name, dim, footprint.ToArray(), a => a != '_').Select(t => t + topLeft); + return TilesWhere(name, dim, footprint.ToArray(), a => includePassable || a != '_').Select(t => t + topLeft); } public static IEnumerable Tiles(Actor a) @@ -38,6 +38,11 @@ namespace OpenRA.Mods.Common.Traits return Tiles(a.World.Map.Rules, a.Info.Name, a.Info.TraitInfo(), a.Location); } + public static IEnumerable FrozenUnderFogTiles(Actor a) + { + return Tiles(a.World.Map.Rules, a.Info.Name, a.Info.TraitInfo(), a.Location, true); + } + public static IEnumerable UnpathableTiles(string name, BuildingInfo buildingInfo, CPos position) { var footprint = buildingInfo.Footprint.Where(x => !char.IsWhiteSpace(x)).ToArray(); diff --git a/OpenRA.Mods.Common/Traits/Modifiers/FrozenUnderFog.cs b/OpenRA.Mods.Common/Traits/Modifiers/FrozenUnderFog.cs index b21f1a279c..bf7470df0b 100644 --- a/OpenRA.Mods.Common/Traits/Modifiers/FrozenUnderFog.cs +++ b/OpenRA.Mods.Common/Traits/Modifiers/FrozenUnderFog.cs @@ -56,7 +56,7 @@ namespace OpenRA.Mods.Common.Traits // Explore map-placed actors if the "Explore Map" option is enabled var exploredMap = !init.World.LobbyInfo.GlobalSettings.Shroud; startsRevealed = exploredMap && init.Contains() && !init.Contains(); - var footprintCells = FootprintUtils.Tiles(init.Self).ToList(); + var footprintCells = FootprintUtils.FrozenUnderFogTiles(init.Self).ToList(); footprint = footprintCells.SelectMany(c => map.ProjectedCellsCovering(c.ToMPos(map))).ToArray(); }