From 9e081763adbf6e2dc1443beb8c883d4d94d9b7a1 Mon Sep 17 00:00:00 2001 From: Thomas Christlieb Date: Wed, 22 Mar 2023 16:51:17 +0100 Subject: [PATCH] fix stance icon not updating when selecting units --- OpenRA.Mods.Common/Scripting/Properties/GeneralProperties.cs | 1 - OpenRA.Mods.Common/Traits/AutoTarget.cs | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/OpenRA.Mods.Common/Scripting/Properties/GeneralProperties.cs b/OpenRA.Mods.Common/Scripting/Properties/GeneralProperties.cs index d7a0f6e46e..3e88924c04 100644 --- a/OpenRA.Mods.Common/Scripting/Properties/GeneralProperties.cs +++ b/OpenRA.Mods.Common/Scripting/Properties/GeneralProperties.cs @@ -175,7 +175,6 @@ namespace OpenRA.Mods.Common.Scripting if (!Enum.TryParse(value, true, out var stance)) throw new LuaException($"Unknown stance type '{value}'"); - autotarget.PredictedStance = stance; autotarget.SetStance(Self, stance); } } diff --git a/OpenRA.Mods.Common/Traits/AutoTarget.cs b/OpenRA.Mods.Common/Traits/AutoTarget.cs index fa5e420977..00c2f67798 100644 --- a/OpenRA.Mods.Common/Traits/AutoTarget.cs +++ b/OpenRA.Mods.Common/Traits/AutoTarget.cs @@ -153,7 +153,7 @@ namespace OpenRA.Mods.Common.Traits return; var oldStance = Stance; - Stance = value; + Stance = PredictedStance = value; ApplyStanceCondition(self); foreach (var nsc in notifyStanceChanged) @@ -204,8 +204,7 @@ namespace OpenRA.Mods.Common.Traits void INotifyOwnerChanged.OnOwnerChanged(Actor self, Player oldOwner, Player newOwner) { - PredictedStance = self.Owner.IsBot || !self.Owner.Playable ? Info.InitialStanceAI : Info.InitialStance; - SetStance(self, PredictedStance); + SetStance(self, self.Owner.IsBot || !self.Owner.Playable ? Info.InitialStanceAI : Info.InitialStance); } void IResolveOrder.ResolveOrder(Actor self, Order order)