From cd92e94d74b8578a71880fe219fbbc222d66bb12 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sat, 1 Dec 2018 11:53:51 +0000 Subject: [PATCH] Remove Order.TargetLocation from Aircraft. --- OpenRA.Mods.Common/Traits/Air/Aircraft.cs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/OpenRA.Mods.Common/Traits/Air/Aircraft.cs b/OpenRA.Mods.Common/Traits/Air/Aircraft.cs index 8d07e71d83..68d38b2195 100644 --- a/OpenRA.Mods.Common/Traits/Air/Aircraft.cs +++ b/OpenRA.Mods.Common/Traits/Air/Aircraft.cs @@ -740,12 +740,17 @@ namespace OpenRA.Mods.Common.Traits public string VoicePhraseForOrder(Actor self, Order order) { - if (!Info.MoveIntoShroud && !self.Owner.Shroud.IsExplored(order.TargetLocation)) - return null; - switch (order.OrderString) { case "Move": + if (!Info.MoveIntoShroud && order.Target.Type != TargetType.Invalid) + { + var cell = self.World.Map.CellContaining(order.Target.CenterPosition); + if (!self.Owner.Shroud.IsExplored(cell)) + return null; + } + + return Info.Voice; case "Enter": case "Stop": return Info.Voice; @@ -759,8 +764,7 @@ namespace OpenRA.Mods.Common.Traits { if (order.OrderString == "Move") { - var cell = self.World.Map.Clamp(order.TargetLocation); - + var cell = self.World.Map.Clamp(self.World.Map.CellContaining(order.Target.CenterPosition)); if (!Info.MoveIntoShroud && !self.Owner.Shroud.IsExplored(cell)) return;