From ed18ecfcaf556de4d6a74104523330625d48c7d0 Mon Sep 17 00:00:00 2001 From: tovl Date: Wed, 10 Jul 2019 16:50:04 +0200 Subject: [PATCH] Allow explicit landing orders to be disabled in yaml. --- OpenRA.Mods.Common/Traits/Air/Aircraft.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/OpenRA.Mods.Common/Traits/Air/Aircraft.cs b/OpenRA.Mods.Common/Traits/Air/Aircraft.cs index cf62f56d41..ec45085bb1 100644 --- a/OpenRA.Mods.Common/Traits/Air/Aircraft.cs +++ b/OpenRA.Mods.Common/Traits/Air/Aircraft.cs @@ -96,6 +96,9 @@ namespace OpenRA.Mods.Common.Traits [Desc("Does this actor automatically take off after creation?")] public readonly bool TakeOffOnCreation = true; + [Desc("Can this actor be given an explicit land order using the force-move modifier?")] + public readonly bool CanForceLand = true; + [Desc("Altitude at which the aircraft considers itself landed.")] public readonly WDist LandAltitude = WDist.Zero; @@ -903,7 +906,7 @@ namespace OpenRA.Mods.Common.Traits get { yield return new EnterAlliedActorTargeter("ForceEnter", 6, - (target, modifiers) => AircraftCanEnter(target) && modifiers.HasModifier(TargetModifiers.ForceMove), + (target, modifiers) => Info.CanForceLand && modifiers.HasModifier(TargetModifiers.ForceMove) && AircraftCanEnter(target), target => Reservable.IsAvailableFor(target, self)); yield return new EnterAlliedActorTargeter("Enter", 5, @@ -1137,7 +1140,7 @@ namespace OpenRA.Mods.Common.Traits if (target.Type != TargetType.Terrain || (aircraft.requireForceMove && !modifiers.HasModifier(TargetModifiers.ForceMove))) return false; - if (modifiers.HasModifier(TargetModifiers.ForceMove)) + if (modifiers.HasModifier(TargetModifiers.ForceMove) && aircraft.Info.CanForceLand) OrderID = "Land"; var location = self.World.Map.CellContaining(target.CenterPosition);