From 3eeb677f14cd78ca1ea83f0fdf9350a3ede76e1b Mon Sep 17 00:00:00 2001 From: Oliver Brakmann Date: Sun, 28 Jun 2020 18:57:48 +0200 Subject: [PATCH] Add LeaveMapAtClosestEdge idle behaviour for Aircraft --- OpenRA.Mods.Common/Traits/Air/Aircraft.cs | 7 +++++++ 1 file changed, 7 insertions(+) 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