From 92912c6c94706f6f193a7d3f8fa1e117d6c92170 Mon Sep 17 00:00:00 2001 From: reaperrr Date: Thu, 1 Nov 2018 00:17:18 +0100 Subject: [PATCH] Add TurnToDock to Aircraft Instead of hard-coding a turn before VTOLs land/dock on resupplier. --- OpenRA.Mods.Common/Activities/Air/HeliReturnToBase.cs | 4 +++- OpenRA.Mods.Common/Traits/Air/Aircraft.cs | 9 +++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/OpenRA.Mods.Common/Activities/Air/HeliReturnToBase.cs b/OpenRA.Mods.Common/Activities/Air/HeliReturnToBase.cs index 1fccc96e02..7ce5e2a7de 100644 --- a/OpenRA.Mods.Common/Activities/Air/HeliReturnToBase.cs +++ b/OpenRA.Mods.Common/Activities/Air/HeliReturnToBase.cs @@ -106,7 +106,9 @@ namespace OpenRA.Mods.Common.Activities { aircraft.MakeReservation(dest); - landingProcedures.Add(new Turn(self, initialFacing)); + if (aircraft.Info.TurnToDock) + landingProcedures.Add(new Turn(self, initialFacing)); + landingProcedures.Add(new HeliLand(self, false)); landingProcedures.Add(new ResupplyAircraft(self)); if (!abortOnResupply) diff --git a/OpenRA.Mods.Common/Traits/Air/Aircraft.cs b/OpenRA.Mods.Common/Traits/Air/Aircraft.cs index 7b07a4726d..82aae460e1 100644 --- a/OpenRA.Mods.Common/Traits/Air/Aircraft.cs +++ b/OpenRA.Mods.Common/Traits/Air/Aircraft.cs @@ -69,9 +69,12 @@ namespace OpenRA.Mods.Common.Traits [Desc("Will this actor try to land after it has no more commands?")] public readonly bool LandWhenIdle = true; - [Desc("Does this actor need to turn before landing?")] + [Desc("Does this VTOL actor need to turn before landing (on terrain)?")] public readonly bool TurnToLand = false; + [Desc("Does this VTOL actor need to turn before landing on a resupplier?")] + public readonly bool TurnToDock = true; + [Desc("Does this actor cancel its previous activity after resupplying?")] public readonly bool AbortOnResupply = true; @@ -752,7 +755,9 @@ namespace OpenRA.Mods.Common.Traits var offset = exit != null ? exit.Info.SpawnOffset : WVec.Zero; self.QueueActivity(new HeliFly(self, Target.FromPos(targetActor.CenterPosition + offset))); - self.QueueActivity(new Turn(self, Info.InitialFacing)); + if (Info.TurnToDock) + self.QueueActivity(new Turn(self, Info.InitialFacing)); + self.QueueActivity(new HeliLand(self, false)); self.QueueActivity(new ResupplyAircraft(self)); };