removed "adjust" param to Tiles; position is now top-left always.
This commit is contained in:
@@ -101,7 +101,8 @@ namespace OpenRa
|
||||
|
||||
public static bool CanPlaceBuilding(this World world, string name, BuildingInfo building, int2 xy, Actor toIgnore, bool adjust)
|
||||
{
|
||||
return !Footprint.Tiles(name, building, xy, adjust).Any(
|
||||
var topLeft = adjust ? xy - Footprint.AdjustForBuildingSize( building ) : xy;
|
||||
return !Footprint.Tiles(name, building, topLeft).Any(
|
||||
t => !world.Map.IsInMap(t.X, t.Y) || world.Map.ContainsResource(t) || !world.IsCellBuildable(t,
|
||||
building.WaterBound ? UnitMovementType.Float : UnitMovementType.Wheel,
|
||||
toIgnore));
|
||||
@@ -126,7 +127,7 @@ namespace OpenRa
|
||||
};
|
||||
|
||||
var topLeft = position - Footprint.AdjustForBuildingSize( bi );
|
||||
foreach (var t in Footprint.Tiles(buildingName, bi, topLeft, false)) search.AddInitialCell(t);
|
||||
foreach (var t in Footprint.Tiles(buildingName, bi, topLeft)) search.AddInitialCell(t);
|
||||
|
||||
return world.PathFinder.FindPath(search).Count != 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user