refactor QueueAttack -> GetAttackActivity
This commit is contained in:
@@ -46,12 +46,9 @@ namespace OpenRA.Mods.RA
|
||||
DoAttack( self, target );
|
||||
}
|
||||
|
||||
protected override void QueueAttack( Actor self, bool queued, Target newTarget )
|
||||
protected override IActivity GetAttackActivity(Actor self, Target newTarget)
|
||||
{
|
||||
if (self.TraitsImplementing<IDisable>().Any(d => d.Disabled))
|
||||
return;
|
||||
|
||||
self.QueueActivity( queued, new AttackActivity( newTarget ) );
|
||||
return new AttackActivity( newTarget );
|
||||
}
|
||||
|
||||
bool buildComplete = false;
|
||||
@@ -66,6 +63,9 @@ namespace OpenRA.Mods.RA
|
||||
{
|
||||
if( IsCanceled ) return NextActivity;
|
||||
|
||||
if (self.TraitsImplementing<IDisable>().Any(d => d.Disabled))
|
||||
return this;
|
||||
|
||||
var attack = self.Trait<AttackTurreted>();
|
||||
const int RangeTolerance = 1; /* how far inside our maximum range we should try to sit */
|
||||
var weapon = attack.ChooseWeaponForTarget(newTarget);
|
||||
|
||||
Reference in New Issue
Block a user