Fix that VTOLs can ignore TurnToDock/-Land

When already at horizontal target position, no Turn was queued.
This commit is contained in:
reaperrr
2019-07-21 16:44:54 +02:00
committed by teinarss
parent d9e1a68453
commit e662f17f06

View File

@@ -130,15 +130,19 @@ namespace OpenRA.Mods.Common.Activities
} }
} }
// Move towards landing location // Move towards landing location/facing
if (aircraft.Info.VTOL && (pos - targetPosition).HorizontalLengthSquared != 0) if (aircraft.Info.VTOL)
{ {
QueueChild(new Fly(self, Target.FromPos(targetPosition))); if ((pos - targetPosition).HorizontalLengthSquared != 0)
{
if (desiredFacing != -1) QueueChild(new Fly(self, Target.FromPos(targetPosition)));
return false;
}
else if (desiredFacing != -1 && desiredFacing != aircraft.Facing)
{
QueueChild(new Turn(self, desiredFacing)); QueueChild(new Turn(self, desiredFacing));
return false;
return false; }
} }
if (!aircraft.Info.VTOL && !finishedApproach) if (!aircraft.Info.VTOL && !finishedApproach)