Fix some stupid bugs; remove hardcoded references to water/ore/tree terraintypes

This commit is contained in:
Paul Chote
2010-06-26 12:02:30 +12:00
parent bf6b2da1a8
commit 08ee425415
13 changed files with 39 additions and 33 deletions

View File

@@ -41,9 +41,8 @@ namespace OpenRA
if (world.WorldActor.traits.Get<BuildingInfluence>().GetBuildingAt(a) != null) return false;
if (world.WorldActor.traits.Get<UnitInfluence>().GetUnitsAt(a).Any(b => b != toIgnore)) return false;
// Todo: Unhardcode "Water" terraintype reference
if (waterBound)
return world.Map.IsInMap(a.X,a.Y) && GetTerrainType(world,a) == "Water";
return world.Map.IsInMap(a.X,a.Y) && GetTerrainInfo(world,a).IsWater;
return world.Map.IsInMap(a.X, a.Y) && world.GetTerrainInfo(a).Buildable;
}