deploy mcv now requires clear space
This commit is contained in:
@@ -156,9 +156,14 @@ namespace OpenRa.Game
|
||||
}
|
||||
|
||||
public static bool IsCellBuildable(int2 a, UnitMovementType umt)
|
||||
{
|
||||
return IsCellBuildable(a, umt, null);
|
||||
}
|
||||
|
||||
public static bool IsCellBuildable(int2 a, UnitMovementType umt, Actor toIgnore)
|
||||
{
|
||||
if (BuildingInfluence.GetBuildingAt(a) != null) return false;
|
||||
if (UnitInfluence.GetUnitAt(a) != null) return false;
|
||||
if (UnitInfluence.GetUnitAt(a) != null && UnitInfluence.GetUnitAt(a) != toIgnore) return false;
|
||||
|
||||
return map.IsInMap(a.X, a.Y) &&
|
||||
TerrainCosts.Cost(umt,
|
||||
@@ -246,6 +251,20 @@ namespace OpenRa.Game
|
||||
return null;
|
||||
}
|
||||
|
||||
public static bool CanPlaceBuilding(string name, int2 xy, Actor toIgnore)
|
||||
{
|
||||
var bi = (UnitInfo.BuildingInfo)Rules.UnitInfo["fact"];
|
||||
return !Footprint.Tiles(bi, xy).Any(
|
||||
t => !Game.IsCellBuildable(t,
|
||||
bi.WaterBound ? UnitMovementType.Float : UnitMovementType.Wheel,
|
||||
toIgnore));
|
||||
}
|
||||
|
||||
public static bool CanPlaceBuilding(string name, int2 xy)
|
||||
{
|
||||
return CanPlaceBuilding(name, xy, null);
|
||||
}
|
||||
|
||||
public static void BuildUnit(Player player, string name)
|
||||
{
|
||||
var producerTypes = Rules.TechTree.UnitBuiltAt( Rules.UnitInfo[ name ] );
|
||||
|
||||
Reference in New Issue
Block a user