diff --git a/OpenRA.Mods.Common/Activities/Air/FlyIdle.cs b/OpenRA.Mods.Common/Activities/Air/FlyIdle.cs index df99b2ce0b..afc7a44a05 100644 --- a/OpenRA.Mods.Common/Activities/Air/FlyIdle.cs +++ b/OpenRA.Mods.Common/Activities/Air/FlyIdle.cs @@ -48,10 +48,12 @@ namespace OpenRA.Mods.Common.Activities foreach (var tickIdle in tickIdles) tickIdle.TickIdle(self); - if (!aircraft.Info.CanHover) + if (aircraft.Info.IdleSpeed > 0 || (!aircraft.Info.CanHover && aircraft.Info.IdleSpeed < 0)) { + var speed = aircraft.Info.IdleSpeed < 0 ? aircraft.Info.Speed : aircraft.Info.IdleSpeed; + // This override is necessary, otherwise aircraft with CanSlide would circle sideways - var move = aircraft.FlyStep(aircraft.Facing); + var move = aircraft.FlyStep(speed, aircraft.Facing); // We can't possibly turn this fast var desiredFacing = aircraft.Facing + new WAngle(256); diff --git a/OpenRA.Mods.Common/Traits/Air/Aircraft.cs b/OpenRA.Mods.Common/Traits/Air/Aircraft.cs index 22d21578c7..6cd54f798b 100644 --- a/OpenRA.Mods.Common/Traits/Air/Aircraft.cs +++ b/OpenRA.Mods.Common/Traits/Air/Aircraft.cs @@ -56,8 +56,12 @@ namespace OpenRA.Mods.Common.Traits [Desc("Turn speed to apply when aircraft flies in circles while idle. Defaults to TurnSpeed if undefined.")] public readonly WAngle? IdleTurnSpeed = null; + [Desc("Maximum flight speed")] public readonly int Speed = 1; + [Desc("If non-negative, force the aircraft to move in circles at this speed when idle (a speed of 0 means don't move), ignoring CanHover.")] + public readonly int IdleSpeed = -1; + [Desc("Body pitch when flying forwards. Only relevant for voxel aircraft.")] public readonly WAngle Pitch = WAngle.Zero;