fix minelayer going to faraway FIX
This commit is contained in:
@@ -30,8 +30,10 @@ namespace OpenRA.Mods.RA.Activities
|
||||
{
|
||||
// rearm & repair at fix, then back out here to refill the minefield some more
|
||||
var buildings = self.Info.Traits.Get<MinelayerInfo>().RearmBuildings;
|
||||
var rearmTarget = self.World.Actors.FirstOrDefault(a => a.Owner != null && self.Owner.Stances[a.Owner] == Stance.Ally
|
||||
&& buildings.Contains(a.Info.Name));
|
||||
var rearmTarget = self.World.Actors.Where(a => a.Owner != null && self.Owner.Stances[a.Owner] == Stance.Ally
|
||||
&& buildings.Contains(a.Info.Name))
|
||||
.OrderBy( a => (a.Location - self.Location).LengthSquared )
|
||||
.FirstOrDefault();
|
||||
|
||||
if (rearmTarget == null)
|
||||
return new Wait(20);
|
||||
|
||||
Reference in New Issue
Block a user