Fix building shroud exploration

This commit is contained in:
Paul Chote
2010-02-05 23:56:54 +13:00
parent a0d99be0dc
commit a08e062d96

View File

@@ -7,6 +7,7 @@ using OpenRa.Graphics;
using OpenRa.Traits; using OpenRa.Traits;
using OpenRa.FileFormats; using OpenRa.FileFormats;
using System.Drawing; using System.Drawing;
using OpenRa.GameRules;
namespace OpenRa namespace OpenRa
{ {
@@ -96,9 +97,17 @@ namespace OpenRa
public void Explore(Actor a) public void Explore(Actor a)
{ {
Explore(a.World, // Buildings: explore from each cell in the footprint
(1f / Game.CellSize * a.CenterLocation).ToInt2(), if (a.Info.Traits.Contains<BuildingInfo>())
a.Info.Traits.Get<OwnedActorInfo>().Sight); {
var bi = a.Info.Traits.Get<BuildingInfo>();
foreach (var t in Footprint.Tiles(a.Info.Name, bi, a.Location))
Explore(a.World,t,a.Info.Traits.Get<OwnedActorInfo>().Sight);
}
else
Explore(a.World,
(1f / Game.CellSize * a.CenterLocation).ToInt2(),
a.Info.Traits.Get<OwnedActorInfo>().Sight);
} }
static readonly byte[][] SpecialShroudTiles = static readonly byte[][] SpecialShroudTiles =