Fix AttackFollow (and consequently AttackTurreted) firing at old target when the trait is reenabled

Most noticeable by ordering a deployed Tick Tank to fire at the ground, then undeploying it and deploying it again.
This commit is contained in:
Pavel Penev
2016-02-13 19:49:43 +02:00
parent ba0781c28d
commit 17ef6efefc

View File

@@ -30,6 +30,12 @@ namespace OpenRA.Mods.Common.Traits
public virtual void Tick(Actor self)
{
if (IsTraitDisabled)
{
Target = Target.Invalid;
return;
}
DoAttack(self, Target);
IsAttacking = Target.IsValidFor(self);
}