clipped voronoi regions for ground control; buildings cannot be placed outside of ground control anymore

This commit is contained in:
Chris Forbes
2009-10-23 20:10:28 +13:00
parent d60775f45c
commit 7d6e254983
7 changed files with 131 additions and 19 deletions

View File

@@ -26,6 +26,11 @@ namespace OpenRa.Game
bi.WaterBound ? UnitMovementType.Float : UnitMovementType.Wheel)))
yield break;
var maxDistance = bi.Adjacent + 2; /* real-ra is weird. this is 1 GAP. */
if (!Footprint.Tiles(bi, xy).Any(
t => Game.GetDistanceToBase(t, Owner) < maxDistance))
yield break;
yield return new PlaceBuildingOrder(this, xy);
}