diff --git a/OpenRA.Mods.Common/Activities/Air/HeliFlyCircle.cs b/OpenRA.Mods.Common/Activities/Air/HeliFlyCircle.cs deleted file mode 100644 index d116900014..0000000000 --- a/OpenRA.Mods.Common/Activities/Air/HeliFlyCircle.cs +++ /dev/null @@ -1,53 +0,0 @@ -#region Copyright & License Information -/* - * Copyright 2007-2019 The OpenRA Developers (see AUTHORS) - * This file is part of OpenRA, which is free software. It is made - * available to you under the terms of the GNU General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. For more - * information, see COPYING. - */ -#endregion - -using OpenRA.Activities; -using OpenRA.Mods.Common.Traits; - -namespace OpenRA.Mods.Common.Activities -{ - public class HeliFlyCircle : Activity - { - readonly Aircraft aircraft; - readonly int turnSpeedOverride; - - public HeliFlyCircle(Actor self, int turnSpeedOverride = -1) - { - aircraft = self.Trait(); - this.turnSpeedOverride = turnSpeedOverride; - } - - public override Activity Tick(Actor self) - { - // Refuse to take off if it would land immediately again. - if (aircraft.ForceLanding) - { - Cancel(self); - return NextActivity; - } - - if (IsCanceling) - return NextActivity; - - if (HeliFly.AdjustAltitude(self, aircraft, aircraft.Info.CruiseAltitude)) - return this; - - var move = aircraft.FlyStep(aircraft.Facing); - aircraft.SetPosition(self, aircraft.CenterPosition + move); - - var desiredFacing = aircraft.Facing + 64; - var turnSpeed = turnSpeedOverride > -1 ? turnSpeedOverride : aircraft.TurnSpeed; - aircraft.Facing = Util.TickFacing(aircraft.Facing, desiredFacing, turnSpeed); - - return this; - } - } -} diff --git a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj index 9bd3fe4434..55efb419b3 100644 --- a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj +++ b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj @@ -72,7 +72,6 @@ - diff --git a/OpenRA.Mods.Common/Traits/Air/Aircraft.cs b/OpenRA.Mods.Common/Traits/Air/Aircraft.cs index e4ea292997..a9f1fbf3cb 100644 --- a/OpenRA.Mods.Common/Traits/Air/Aircraft.cs +++ b/OpenRA.Mods.Common/Traits/Air/Aircraft.cs @@ -619,11 +619,11 @@ namespace OpenRA.Mods.Common.Traits self.QueueActivity(new FlyCircle(self, -1, Info.IdleTurnSpeed > -1 ? Info.IdleTurnSpeed : TurnSpeed)); else if (atLandAltitude && !CanLand(self.Location) && ReservedActor == null) self.QueueActivity(new TakeOff(self)); - else if (Info.CanHover && self.Info.HasTraitInfo() && Info.IdleTurnSpeed > -1) + else if (Info.CanHover && Info.IdleTurnSpeed > 0) { - // Temporary HACK for the AutoCarryall special case (needs CanHover, but also HeliFlyCircle on idle). + // Temporary HACK for the AutoCarryall special case (needs CanHover, but also FlyCircle on idle). // Will go away soon (in a separate PR) with the arrival of ActionsWhenIdle. - self.QueueActivity(new HeliFlyCircle(self, Info.IdleTurnSpeed > -1 ? Info.IdleTurnSpeed : TurnSpeed)); + self.QueueActivity(new FlyCircle(self, -1, Info.IdleTurnSpeed > -1 ? Info.IdleTurnSpeed : TurnSpeed)); } }