diff --git a/OpenRA.Mods.Common/Traits/Air/Aircraft.cs b/OpenRA.Mods.Common/Traits/Air/Aircraft.cs index c793b6beee..22d21578c7 100644 --- a/OpenRA.Mods.Common/Traits/Air/Aircraft.cs +++ b/OpenRA.Mods.Common/Traits/Air/Aircraft.cs @@ -27,6 +27,7 @@ namespace OpenRA.Mods.Common.Traits Land, ReturnToBase, LeaveMap, + LeaveMapAtClosestEdge } public class AircraftInfo : PausableConditionalTraitInfo, IPositionableInfo, IFacingInfo, IMoveInfo, ICruiseAltitudeInfo, @@ -725,6 +726,12 @@ namespace OpenRA.Mods.Common.Traits self.QueueActivity(new FlyOffMap(self)); self.QueueActivity(new RemoveSelf()); } + else if (Info.IdleBehavior == IdleBehaviorType.LeaveMapAtClosestEdge) + { + var edgeCell = self.World.Map.ChooseClosestEdgeCell(self.Location); + self.QueueActivity(new FlyOffMap(self, Target.FromCell(self.World, edgeCell))); + self.QueueActivity(new RemoveSelf()); + } else if (Info.IdleBehavior == IdleBehaviorType.ReturnToBase && GetActorBelow() == null) self.QueueActivity(new ReturnToBase(self, null, !Info.TakeOffOnResupply)); else