fix IdleAnimation. add IsAttacking to AttackBase

This commit is contained in:
Bob
2010-09-22 12:21:49 +12:00
parent 694fb6831a
commit d8de477edb
5 changed files with 12 additions and 6 deletions

View File

@@ -27,6 +27,14 @@ namespace OpenRA.Mods.RA.Activities
}
public override IActivity Tick( Actor self )
{
var attack = self.Trait<AttackBase>();
var ret = InnerTick( self, attack );
attack.IsAttacking = ( ret == this );
return ret;
}
IActivity InnerTick( Actor self, AttackBase attack )
{
if (IsCanceled) return NextActivity;
var facing = self.Trait<IFacing>();
@@ -49,7 +57,6 @@ namespace OpenRA.Mods.RA.Activities
return Util.SequenceActivities( new Turn( desiredFacing ), this );
}
var attack = self.Trait<AttackBase>();
attack.target = Target;
attack.DoAttack(self);
return this;