Reset unit stance on owner change.
This commit is contained in:
@@ -109,7 +109,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
}
|
||||
}
|
||||
|
||||
public class AutoTarget : ConditionalTrait<AutoTargetInfo>, INotifyIdle, INotifyDamage, ITick, IResolveOrder, ISync, INotifyCreated
|
||||
public class AutoTarget : ConditionalTrait<AutoTargetInfo>, INotifyIdle, INotifyDamage, ITick, IResolveOrder, ISync, INotifyCreated, INotifyOwnerChanged
|
||||
{
|
||||
readonly IEnumerable<AttackBase> activeAttackBases;
|
||||
readonly AttackFollow[] attackFollows;
|
||||
@@ -177,6 +177,12 @@ namespace OpenRA.Mods.Common.Traits
|
||||
ApplyStanceCondition(self);
|
||||
}
|
||||
|
||||
void INotifyOwnerChanged.OnOwnerChanged(Actor self, Player oldOwner, Player newOwner)
|
||||
{
|
||||
PredictedStance = self.Owner.IsBot || !self.Owner.Playable ? Info.InitialStanceAI : Info.InitialStance;
|
||||
SetStance(self, PredictedStance);
|
||||
}
|
||||
|
||||
void IResolveOrder.ResolveOrder(Actor self, Order order)
|
||||
{
|
||||
if (order.OrderString == "SetUnitStance" && Info.EnableStances)
|
||||
|
||||
Reference in New Issue
Block a user