diff --git a/OpenRA.Mods.Common/Activities/Air/HeliReturnToBase.cs b/OpenRA.Mods.Common/Activities/Air/HeliReturnToBase.cs index 98b6adc019..67581d7569 100644 --- a/OpenRA.Mods.Common/Activities/Air/HeliReturnToBase.cs +++ b/OpenRA.Mods.Common/Activities/Air/HeliReturnToBase.cs @@ -21,12 +21,14 @@ namespace OpenRA.Mods.Common.Activities readonly Aircraft heli; readonly bool alwaysLand; readonly bool abortOnResupply; + Actor dest; - public HeliReturnToBase(Actor self, bool abortOnResupply, bool alwaysLand = true) + public HeliReturnToBase(Actor self, bool abortOnResupply, Actor dest = null, bool alwaysLand = true) { heli = self.Trait(); this.alwaysLand = alwaysLand; this.abortOnResupply = abortOnResupply; + this.dest = dest; } public Actor ChooseHelipad(Actor self) @@ -41,7 +43,9 @@ namespace OpenRA.Mods.Common.Activities if (IsCanceled) return NextActivity; - var dest = ChooseHelipad(self); + if (dest == null || Reservable.IsReserved(dest)) + dest = ChooseHelipad(self); + var initialFacing = heli.Info.InitialFacing; if (dest == null) diff --git a/OpenRA.Mods.Common/Scripting/Properties/AircraftProperties.cs b/OpenRA.Mods.Common/Scripting/Properties/AircraftProperties.cs index 13b71c126d..aed47133d3 100644 --- a/OpenRA.Mods.Common/Scripting/Properties/AircraftProperties.cs +++ b/OpenRA.Mods.Common/Scripting/Properties/AircraftProperties.cs @@ -38,13 +38,13 @@ namespace OpenRA.Mods.Common.Scripting } [ScriptActorPropertyActivity] - [Desc("Return to the base, which is either the airfield given, or an auto-selected one otherwise.")] - public void ReturnToBase(Actor airfield = null) + [Desc("Return to the base, which is either the destination given, or an auto-selected one otherwise.")] + public void ReturnToBase(Actor destination = null) { if (isPlane) - Self.QueueActivity(new ReturnToBase(Self, false, airfield)); + Self.QueueActivity(new ReturnToBase(Self, false, destination)); else - Self.QueueActivity(new HeliReturnToBase(Self, false)); + Self.QueueActivity(new HeliReturnToBase(Self, false, destination)); } [ScriptActorPropertyActivity] diff --git a/OpenRA.Mods.Common/Traits/Air/Aircraft.cs b/OpenRA.Mods.Common/Traits/Air/Aircraft.cs index 9913652d8f..c43946e7f8 100644 --- a/OpenRA.Mods.Common/Traits/Air/Aircraft.cs +++ b/OpenRA.Mods.Common/Traits/Air/Aircraft.cs @@ -635,7 +635,7 @@ namespace OpenRA.Mods.Common.Traits if (IsPlane) self.QueueActivity(new ReturnToBase(self, Info.AbortOnResupply, null, false)); else - self.QueueActivity(new HeliReturnToBase(self, Info.AbortOnResupply, false)); + self.QueueActivity(new HeliReturnToBase(self, Info.AbortOnResupply, null, false)); } }