fix interaction between autoattack and idleanimation
This commit is contained in:
@@ -68,12 +68,11 @@ namespace OpenRA
|
||||
|
||||
public void Tick()
|
||||
{
|
||||
var wasIdle = currentActivity is Idle;
|
||||
currentActivity = Util.RunActivity( this, currentActivity ) ?? new Idle();
|
||||
|
||||
if (currentActivity is Idle && !wasIdle)
|
||||
if (currentActivity == null)
|
||||
foreach (var ni in TraitsImplementing<INotifyIdle>())
|
||||
ni.Idle(this);
|
||||
ni.TickIdle(this);
|
||||
|
||||
currentActivity = Util.RunActivity( this, currentActivity );
|
||||
}
|
||||
|
||||
public bool IsIdle
|
||||
|
||||
@@ -203,7 +203,7 @@ namespace OpenRA.Traits
|
||||
}
|
||||
|
||||
public interface IRenderOverlay { void Render( WorldRenderer wr ); }
|
||||
public interface INotifyIdle { void Idle(Actor self); }
|
||||
public interface INotifyIdle { void TickIdle(Actor self); }
|
||||
|
||||
public interface IBlocksBullets { }
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace OpenRA.Mods.RA.Air
|
||||
|
||||
class ReturnOnIdle : INotifyIdle
|
||||
{
|
||||
public void Idle(Actor self)
|
||||
public void TickIdle(Actor self)
|
||||
{
|
||||
var altitude = self.Trait<Aircraft>().Altitude;
|
||||
if (altitude == 0) return; // we're on the ground, let's stay there.
|
||||
@@ -44,7 +44,7 @@ namespace OpenRA.Mods.RA.Air
|
||||
|
||||
class FlyAwayOnIdle : INotifyIdle
|
||||
{
|
||||
public void Idle(Actor self)
|
||||
public void TickIdle(Actor self)
|
||||
{
|
||||
self.QueueActivity(new FlyOffMap());
|
||||
self.QueueActivity(new RemoveSelf());
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace OpenRA.Mods.RA
|
||||
|
||||
class AutoHeal : INotifyIdle
|
||||
{
|
||||
public void Idle( Actor self )
|
||||
public void TickIdle( Actor self )
|
||||
{
|
||||
self.QueueActivity( new IdleHealActivity() );
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace OpenRA.Mods.RA
|
||||
self.Trait<AttackBase>().AttackTarget(Target.FromActor(e.Attacker), false, self.Info.Traits.Get<AutoTargetInfo>().AllowMovement);
|
||||
}
|
||||
|
||||
public void Idle( Actor self )
|
||||
public void TickIdle( Actor self )
|
||||
{
|
||||
self.QueueActivity( new IdleAttackActivity() );
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace OpenRA.Mods.RA
|
||||
self.CancelActivity();
|
||||
}
|
||||
|
||||
public void Idle(Actor self)
|
||||
public void TickIdle(Actor self)
|
||||
{
|
||||
self.QueueActivity(new Activities.IdleAnimation(Info.Animations.Random(self.World.SharedRandom),
|
||||
Info.IdleWaitTicks));
|
||||
|
||||
Reference in New Issue
Block a user