fix stance icon not updating when selecting units
This commit is contained in:
committed by
Gustas
parent
378f66a1ff
commit
9e081763ad
@@ -175,7 +175,6 @@ namespace OpenRA.Mods.Common.Scripting
|
|||||||
if (!Enum<UnitStance>.TryParse(value, true, out var stance))
|
if (!Enum<UnitStance>.TryParse(value, true, out var stance))
|
||||||
throw new LuaException($"Unknown stance type '{value}'");
|
throw new LuaException($"Unknown stance type '{value}'");
|
||||||
|
|
||||||
autotarget.PredictedStance = stance;
|
|
||||||
autotarget.SetStance(Self, stance);
|
autotarget.SetStance(Self, stance);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
var oldStance = Stance;
|
var oldStance = Stance;
|
||||||
Stance = value;
|
Stance = PredictedStance = value;
|
||||||
ApplyStanceCondition(self);
|
ApplyStanceCondition(self);
|
||||||
|
|
||||||
foreach (var nsc in notifyStanceChanged)
|
foreach (var nsc in notifyStanceChanged)
|
||||||
@@ -204,8 +204,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
|
|
||||||
void INotifyOwnerChanged.OnOwnerChanged(Actor self, Player oldOwner, Player newOwner)
|
void INotifyOwnerChanged.OnOwnerChanged(Actor self, Player oldOwner, Player newOwner)
|
||||||
{
|
{
|
||||||
PredictedStance = self.Owner.IsBot || !self.Owner.Playable ? Info.InitialStanceAI : Info.InitialStance;
|
SetStance(self, self.Owner.IsBot || !self.Owner.Playable ? Info.InitialStanceAI : Info.InitialStance);
|
||||||
SetStance(self, PredictedStance);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void IResolveOrder.ResolveOrder(Actor self, Order order)
|
void IResolveOrder.ResolveOrder(Actor self, Order order)
|
||||||
|
|||||||
Reference in New Issue
Block a user