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

@@ -15,7 +15,7 @@ using OpenRA.Graphics;
namespace OpenRA.Traits
{
public class ResourceLayerInfo : TraitInfo<ResourceLayer>, Requires<UnitInfluenceInfo> { }
public class ResourceLayerInfo : TraitInfo<ResourceLayer> { }
public class ResourceLayer: IRenderOverlay, IWorldLoaded
{
@@ -84,7 +84,7 @@ namespace OpenRA.Traits
{
if (!world.Map.IsInMap(a.X, a.Y)) return false;
if (!rt.info.AllowedTerrainTypes.Contains(world.GetTerrainInfo(a).Type)) return false;
if (!rt.info.AllowUnderActors && world.WorldActor.Trait<UnitInfluence>().AnyUnitsAt(a)) return false;
if (!rt.info.AllowUnderActors && world.ActorMap.AnyUnitsAt(a)) return false;
return true;
}