Merge pull request #11445 from abcdefg30/emp-support-power

Emp support power take 2
This commit is contained in:
reaperrr
2016-06-18 21:14:01 +02:00
committed by GitHub
7 changed files with 193 additions and 5 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;