Less carp

This commit is contained in:
Paul Chote
2010-03-21 18:09:36 +13:00
parent b4540db406
commit 5b2dbc2389
7 changed files with 20 additions and 22 deletions

View File

@@ -32,7 +32,7 @@ namespace OpenRA.Traits
{
public ProductionSurround(Actor self) : base(self) { }
static int2? FindAdjacentTile(Actor self, UnitMovementType umt)
static int2? FindAdjacentTile(Actor self, bool waterBound)
{
var tiles = Footprint.Tiles(self, self.traits.Get<Traits.Building>());
var min = tiles.Aggregate(int2.Min) - new int2(1, 1);
@@ -40,7 +40,7 @@ namespace OpenRA.Traits
for (var j = min.Y; j <= max.Y; j++)
for (var i = min.X; i <= max.X; i++)
if (self.World.IsCellBuildable(new int2(i, j), umt))
if (self.World.IsCellBuildable(new int2(i, j), waterBound))
return new int2(i, j);
return null;
@@ -48,8 +48,7 @@ namespace OpenRA.Traits
public override int2? CreationLocation(Actor self, ActorInfo producee)
{
return FindAdjacentTile(self, producee.Traits.Get<OwnedActorInfo>().WaterBound ?
UnitMovementType.Float : UnitMovementType.Wheel); /* hackety hack */
return FindAdjacentTile(self, producee.Traits.Get<OwnedActorInfo>().WaterBound);
}
public override int CreationFacing(Actor self, Actor newUnit)