From e662f17f067d0b6c2fc14422c380d24e3e0e16ef Mon Sep 17 00:00:00 2001 From: reaperrr Date: Sun, 21 Jul 2019 16:44:54 +0200 Subject: [PATCH] Fix that VTOLs can ignore TurnToDock/-Land When already at horizontal target position, no Turn was queued. --- OpenRA.Mods.Common/Activities/Air/Land.cs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/OpenRA.Mods.Common/Activities/Air/Land.cs b/OpenRA.Mods.Common/Activities/Air/Land.cs index d70e0cc6a2..7c544f9224 100644 --- a/OpenRA.Mods.Common/Activities/Air/Land.cs +++ b/OpenRA.Mods.Common/Activities/Air/Land.cs @@ -130,15 +130,19 @@ namespace OpenRA.Mods.Common.Activities } } - // Move towards landing location - if (aircraft.Info.VTOL && (pos - targetPosition).HorizontalLengthSquared != 0) + // Move towards landing location/facing + if (aircraft.Info.VTOL) { - QueueChild(new Fly(self, Target.FromPos(targetPosition))); - - if (desiredFacing != -1) + if ((pos - targetPosition).HorizontalLengthSquared != 0) + { + QueueChild(new Fly(self, Target.FromPos(targetPosition))); + return false; + } + else if (desiredFacing != -1 && desiredFacing != aircraft.Facing) + { QueueChild(new Turn(self, desiredFacing)); - - return false; + return false; + } } if (!aircraft.Info.VTOL && !finishedApproach)