Refactor AutoHeal.

This commit is contained in:
Paul Chote
2010-11-30 14:20:15 +13:00
parent 2e7b5e8712
commit dfd5906d7f
2 changed files with 10 additions and 37 deletions

View File

@@ -40,10 +40,10 @@ namespace OpenRA.Mods.RA
public void TickIdle( Actor self )
{
var attack = self.Trait<AttackBase>();
var currentTarget = attack.ScanForTarget(self, null);
if( currentTarget != null )
var target = attack.ScanForTarget(self, null);
if( target != null )
self.QueueActivity(attack.GetAttackActivity( self,
Target.FromActor(currentTarget),
Target.FromActor(target),
self.Info.Traits.Get<AutoTargetInfo>().AllowMovement
));
}