Add AttackOrderPower as Supportpower

This commit is contained in:
teees
2016-04-20 08:10:54 +02:00
committed by abcdefg30
parent f05c537491
commit 86eabeea3f
3 changed files with 151 additions and 1 deletions

View File

@@ -235,7 +235,8 @@ namespace OpenRA.Mods.Common.Traits
if (!Ready)
return;
var power = Instances.FirstOrDefault(i => !InstanceDisabled(i));
var power = Instances.Where(i => !InstanceDisabled(i))
.MinByOrDefault(a => (a.Self.CenterPosition - a.Self.World.Map.CenterOfCell(order.TargetLocation)).HorizontalLengthSquared);
if (power == null)
return;