use ChooseAirfield in ReturnToBase.Tick bailout

This commit is contained in:
Chris Forbes
2012-09-14 23:20:18 +12:00
parent a641c7a87d
commit ea641f081f

View File

@@ -94,11 +94,7 @@ namespace OpenRA.Mods.RA.Air
Calculate(self);
if (dest == null)
{
var rearmBuildings = self.Info.Traits.Get<PlaneInfo>().RearmBuildings;
var nearestAfld = self.World.ActorsWithTrait<Reservable>()
.Where(a => a.Actor.Owner == self.Owner && rearmBuildings.Contains(a.Actor.Info.Name))
.Select(a => a.Actor)
.ClosestTo(self.CenterLocation);
var nearestAfld = ChooseAirfield(self, false);
self.CancelActivity();
return Util.SequenceActivities(Fly.ToCell(nearestAfld.Location), new FlyCircle());