From a08e062d96e36554c0c5991c005bf36c8efb6d68 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Fri, 5 Feb 2010 23:56:54 +1300 Subject: [PATCH] Fix building shroud exploration --- OpenRa.Game/Shroud.cs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/OpenRa.Game/Shroud.cs b/OpenRa.Game/Shroud.cs index 59639c5293..44847ef606 100644 --- a/OpenRa.Game/Shroud.cs +++ b/OpenRa.Game/Shroud.cs @@ -7,6 +7,7 @@ using OpenRa.Graphics; using OpenRa.Traits; using OpenRa.FileFormats; using System.Drawing; +using OpenRa.GameRules; namespace OpenRa { @@ -96,9 +97,17 @@ namespace OpenRa public void Explore(Actor a) { - Explore(a.World, - (1f / Game.CellSize * a.CenterLocation).ToInt2(), - a.Info.Traits.Get().Sight); + // Buildings: explore from each cell in the footprint + if (a.Info.Traits.Contains()) + { + var bi = a.Info.Traits.Get(); + foreach (var t in Footprint.Tiles(a.Info.Name, bi, a.Location)) + Explore(a.World,t,a.Info.Traits.Get().Sight); + } + else + Explore(a.World, + (1f / Game.CellSize * a.CenterLocation).ToInt2(), + a.Info.Traits.Get().Sight); } static readonly byte[][] SpecialShroudTiles =