diff --git a/OpenRA.Mods.RA/IdleAnimation.cs b/OpenRA.Mods.RA/IdleAnimation.cs index 3e417aa7a0..c42ba51fc9 100644 --- a/OpenRA.Mods.RA/IdleAnimation.cs +++ b/OpenRA.Mods.RA/IdleAnimation.cs @@ -15,7 +15,8 @@ namespace OpenRA.Mods.RA { class IdleAnimationInfo : ITraitInfo, ITraitPrerequisite { - public readonly int IdleWaitTicks = 50; + public readonly int MinIdleWaitTicks = 30; + public readonly int MaxIdleWaitTicks = 110; public readonly string[] Animations = {}; public object Create(ActorInitializer init) { return new IdleAnimation(this); } } @@ -56,7 +57,15 @@ namespace OpenRA.Mods.RA var ri = self.TraitOrDefault(); if (ri.anim.HasSequence(sequence)) - ri.anim.PlayThen(sequence, () => state = IdleState.None); + { + var previousSequence = ri.anim.CurrentSequence.Name; + ri.anim.PlayThen(sequence, + () => + { + state = IdleState.None; + ri.anim.PlayRepeating(previousSequence); + }); + } else state = IdleState.None; } @@ -68,8 +77,8 @@ namespace OpenRA.Mods.RA return; state = IdleState.Waiting; - sequence = Info.Animations.Random(self.World.SharedRandom); - delay = Info.IdleWaitTicks; + sequence = Info.Animations.Random(self.World.SharedRandom); + delay = self.World.SharedRandom.Next(Info.MinIdleWaitTicks, Info.MaxIdleWaitTicks); } } }