From 5698ea0910296a925b02ce01313beb82f057442e Mon Sep 17 00:00:00 2001 From: reaperrr Date: Wed, 1 May 2019 14:50:03 +0200 Subject: [PATCH] Remove HeliFlyAndLandWhenIdle Already obsolete, as aircraft with CanHover do properly become idle and land when LandOnIdle is set to 'true'. They currently need VTOL too, but all CanHover-aircraft in the shipping mods have that and it will be fixed soon as well. --- OpenRA.Mods.Common/Activities/Air/HeliFly.cs | 26 -------------------- OpenRA.Mods.Common/Traits/Air/Aircraft.cs | 4 +-- 2 files changed, 2 insertions(+), 28 deletions(-) diff --git a/OpenRA.Mods.Common/Activities/Air/HeliFly.cs b/OpenRA.Mods.Common/Activities/Air/HeliFly.cs index 0858204a70..d466e6a7d3 100644 --- a/OpenRA.Mods.Common/Activities/Air/HeliFly.cs +++ b/OpenRA.Mods.Common/Activities/Air/HeliFly.cs @@ -145,30 +145,4 @@ namespace OpenRA.Mods.Common.Activities yield return target; } } - - public class HeliFlyAndLandWhenIdle : HeliFly - { - private readonly AircraftInfo info; - - public HeliFlyAndLandWhenIdle(Actor self, Target t, AircraftInfo info) - : base(self, t) - { - this.info = info; - } - - public override Activity Tick(Actor self) - { - var activity = base.Tick(self); - - if (activity == null && !IsCanceling && info.LandWhenIdle) - { - if (info.TurnToLand) - self.QueueActivity(new Turn(self, info.InitialFacing)); - self.QueueActivity(new Land(self)); - activity = NextActivity; - } - - return activity; - } - } } diff --git a/OpenRA.Mods.Common/Traits/Air/Aircraft.cs b/OpenRA.Mods.Common/Traits/Air/Aircraft.cs index 1cb03d74d9..09f6095564 100644 --- a/OpenRA.Mods.Common/Traits/Air/Aircraft.cs +++ b/OpenRA.Mods.Common/Traits/Air/Aircraft.cs @@ -946,7 +946,7 @@ namespace OpenRA.Mods.Common.Traits if (!Info.CanHover) self.QueueActivity(order.Queued, new Fly(self, target)); else - self.QueueActivity(order.Queued, new HeliFlyAndLandWhenIdle(self, target, Info)); + self.QueueActivity(order.Queued, new HeliFly(self, target)); } else if (order.OrderString == "Enter" || order.OrderString == "Repair") { @@ -1012,7 +1012,7 @@ namespace OpenRA.Mods.Common.Traits if (!Info.CanHover) self.QueueActivity(new Fly(self, target)); else - self.QueueActivity(new HeliFlyAndLandWhenIdle(self, target, Info)); + self.QueueActivity(new HeliFly(self, target)); UnReserve(); }