Refactor UnitInfluence trait -> world.ActorMap

This commit is contained in:
Paul Chote
2011-05-22 13:06:14 +12:00
parent d6496cb5be
commit d4baf2d757
25 changed files with 49 additions and 73 deletions

View File

@@ -24,7 +24,7 @@ namespace OpenRA.Mods.RA.Buildings
public static bool IsCellBuildable(this World world, int2 a, bool waterBound, Actor toIgnore)
{
if (world.WorldActor.Trait<BuildingInfluence>().GetBuildingAt(a) != null) return false;
if (world.WorldActor.Trait<UnitInfluence>().GetUnitsAt(a).Any(b => b != toIgnore)) return false;
if (world.ActorMap.GetUnitsAt(a).Any(b => b != toIgnore)) return false;
if (waterBound)
return world.Map.IsInMap(a.X,a.Y) && world.GetTerrainInfo(a).IsWater;