From b27289106d03aa9804fbd50e82005f7b3b6c21b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Tue, 29 Aug 2017 15:22:40 +0200 Subject: [PATCH] Don't give an okay voice when not allowed to move into shroud. --- OpenRA.Mods.Common/Traits/Air/Aircraft.cs | 3 +++ OpenRA.Mods.Common/Traits/AttackMove.cs | 3 +++ OpenRA.Mods.Common/Traits/Mobile.cs | 3 +++ 3 files changed, 9 insertions(+) diff --git a/OpenRA.Mods.Common/Traits/Air/Aircraft.cs b/OpenRA.Mods.Common/Traits/Air/Aircraft.cs index 9ea9e01f9a..4c690dff42 100644 --- a/OpenRA.Mods.Common/Traits/Air/Aircraft.cs +++ b/OpenRA.Mods.Common/Traits/Air/Aircraft.cs @@ -668,6 +668,9 @@ 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": diff --git a/OpenRA.Mods.Common/Traits/AttackMove.cs b/OpenRA.Mods.Common/Traits/AttackMove.cs index aacdf7fb98..c9a0f6a7d8 100644 --- a/OpenRA.Mods.Common/Traits/AttackMove.cs +++ b/OpenRA.Mods.Common/Traits/AttackMove.cs @@ -83,6 +83,9 @@ namespace OpenRA.Mods.Common.Traits string IOrderVoice.VoicePhraseForOrder(Actor self, Order order) { + if (!info.MoveIntoShroud && !self.Owner.Shroud.IsExplored(order.TargetLocation)) + return null; + if (order.OrderString == "AttackMove" || order.OrderString == "AssaultMove") return info.Voice; diff --git a/OpenRA.Mods.Common/Traits/Mobile.cs b/OpenRA.Mods.Common/Traits/Mobile.cs index 38e81adf1b..19744bc329 100644 --- a/OpenRA.Mods.Common/Traits/Mobile.cs +++ b/OpenRA.Mods.Common/Traits/Mobile.cs @@ -649,6 +649,9 @@ 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":