Add target param to INotifyAttack. Remove target field from AttackOmni
This commit is contained in:
@@ -22,7 +22,6 @@ namespace OpenRA.Mods.RA
|
||||
class AttackOmni : AttackBase, INotifyBuildComplete
|
||||
{
|
||||
bool buildComplete = false;
|
||||
protected Target target;
|
||||
public void BuildingComplete(Actor self) { buildComplete = true; }
|
||||
|
||||
public AttackOmni(Actor self) : base(self) { }
|
||||
@@ -33,12 +32,6 @@ namespace OpenRA.Mods.RA
|
||||
return base.CanAttack( self, target ) && !isBuilding;
|
||||
}
|
||||
|
||||
public override void Tick(Actor self)
|
||||
{
|
||||
base.Tick(self);
|
||||
DoAttack(self, target);
|
||||
}
|
||||
|
||||
protected override IActivity GetAttackActivity(Actor self, Target newTarget, bool allowMove)
|
||||
{
|
||||
return new SetTarget( newTarget );
|
||||
@@ -54,7 +47,7 @@ namespace OpenRA.Mods.RA
|
||||
if( IsCanceled || !target.IsValid )
|
||||
return NextActivity;
|
||||
|
||||
self.Trait<AttackOmni>().target = target;
|
||||
self.Trait<AttackOmni>().DoAttack(self, target);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user