Add LeaveMapAtClosestEdge idle behaviour for Aircraft

This commit is contained in:
Oliver Brakmann
2020-06-28 18:57:48 +02:00
committed by Paul Chote
parent ef69a3de66
commit 3eeb677f14

View File

@@ -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