Add AllowInvalidPlacement check to IsCellBuildable. Fixes #5902.

This commit is contained in:
Paul Chote
2014-07-10 17:06:57 +12:00
parent fd68c81b15
commit 05e1841e0e

View File

@@ -23,8 +23,11 @@ namespace OpenRA.Mods.RA.Buildings
public static bool IsCellBuildable(this World world, CPos a, BuildingInfo bi, Actor toIgnore)
{
if (world.WorldActor.Trait<BuildingInfluence>().GetBuildingAt(a) != null) return false;
if (world.ActorMap.GetUnitsAt(a).Any(b => b != toIgnore)) return false;
if (world.WorldActor.Trait<BuildingInfluence>().GetBuildingAt(a) != null)
return false;
if (!bi.AllowInvalidPlacement && world.ActorMap.GetUnitsAt(a).Any(b => b != toIgnore))
return false;
return world.Map.Contains(a) && bi.TerrainTypes.Contains(world.Map.GetTerrainInfo(a).Type);
}