Add FrozenActor target type.

This commit is contained in:
Paul Chote
2013-08-08 14:34:49 +12:00
parent c0cb52a5ca
commit 40a9caddc7
5 changed files with 59 additions and 28 deletions

View File

@@ -134,13 +134,7 @@ namespace OpenRA.Traits
public static IEnumerable<CPos> AdjacentCells(Target target)
{
var cells = target.Type == TargetType.Actor
? target.Actor.OccupiesSpace.OccupiedCells().Select(c => c.First).ToArray()
: new CPos[] { };
if (cells.Length == 0)
cells = new CPos[] { target.CenterPosition.ToCPos() };
var cells = target.Positions.Select(p => p.ToCPos()).Distinct();
return Util.ExpandFootprint(cells, true);
}
}