From ac42dd79ca9c9a1445cb7eabfe193451f3c362cf Mon Sep 17 00:00:00 2001 From: abcdefg30 Date: Mon, 16 Dec 2019 17:34:03 +0100 Subject: [PATCH] Make the command bar directly check if a GuardOrderGenerator is active --- OpenRA.Mods.Common/Widgets/Logic/Ingame/CommandBarLogic.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/CommandBarLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/CommandBarLogic.cs index b1d640b53c..3c47162b04 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/CommandBarLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/CommandBarLogic.cs @@ -114,8 +114,7 @@ namespace OpenRA.Mods.Common.Widgets BindButtonIcon(guardButton); guardButton.IsDisabled = () => { UpdateStateIfNecessary(); return guardDisabled; }; - guardButton.IsHighlighted = () => world.OrderGenerator is GenericSelectTarget - && ((GenericSelectTarget)world.OrderGenerator).OrderName == "Guard"; + guardButton.IsHighlighted = () => world.OrderGenerator is GuardOrderGenerator; Action toggle = allowCancel => {