Skip to content

Commit

Permalink
fix stance icon not updating when selecting units
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasChr authored and PunkPun committed Mar 28, 2023
1 parent 378f66a commit 9e08176
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ public string Stance
if (!Enum<UnitStance>.TryParse(value, true, out var stance))
throw new LuaException($"Unknown stance type '{value}'");

autotarget.PredictedStance = stance;
autotarget.SetStance(Self, stance);
}
}
Expand Down
5 changes: 2 additions & 3 deletions OpenRA.Mods.Common/Traits/AutoTarget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public void SetStance(Actor self, UnitStance value)
return;

var oldStance = Stance;
Stance = value;
Stance = PredictedStance = value;
ApplyStanceCondition(self);

foreach (var nsc in notifyStanceChanged)
Expand Down Expand Up @@ -204,8 +204,7 @@ protected override void Created(Actor self)

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)
Expand Down

0 comments on commit 9e08176

Please sign in to comment.