water-bound structures can now be placed only in water

This commit is contained in:
Chris Forbes
2009-10-22 23:24:55 +13:00
parent 45139015c5
commit b73e5a62bb
2 changed files with 8 additions and 3 deletions

View File

@@ -20,7 +20,10 @@ namespace OpenRa.Game
public IEnumerable<Order> Order(int2 xy)
{
// todo: check that space is free
if (Footprint.Tiles(Rules.UnitInfo[Name], xy).Any(t => !Game.IsCellBuildable(t, UnitMovementType.Wheel)))
var bi = (UnitInfo.BuildingInfo)Rules.UnitInfo[Name];
if (Footprint.Tiles(bi, xy).Any(
t => !Game.IsCellBuildable(t,
bi.WaterBound ? UnitMovementType.Float : UnitMovementType.Wheel)))
yield break;
yield return new PlaceBuildingOrder(this, xy);