fix infantry without idle animation not returning to stand
This commit is contained in:
@@ -82,7 +82,7 @@ namespace OpenRA.Mods.RA.Render
|
|||||||
|
|
||||||
protected virtual bool AllowIdleAnimation(Actor self)
|
protected virtual bool AllowIdleAnimation(Actor self)
|
||||||
{
|
{
|
||||||
return info.IdleAnimations.Length > 0 && !isModifyingSequence;
|
return !isModifyingSequence;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Attacking(Actor self, Target target)
|
public void Attacking(Actor self, Target target)
|
||||||
@@ -136,16 +136,24 @@ namespace OpenRA.Mods.RA.Render
|
|||||||
idleDelay = self.World.SharedRandom.Next(info.MinIdleWaitTicks, info.MaxIdleWaitTicks);
|
idleDelay = self.World.SharedRandom.Next(info.MinIdleWaitTicks, info.MaxIdleWaitTicks);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (AllowIdleAnimation(self) && idleDelay > 0 && --idleDelay == 0)
|
else if (AllowIdleAnimation(self))
|
||||||
{
|
{
|
||||||
if (DefaultAnimation.HasSequence(idleSequence))
|
if (idleSequence != null && DefaultAnimation.HasSequence(idleSequence))
|
||||||
{
|
{
|
||||||
state = AnimationState.IdleAnimating;
|
if (idleDelay > 0 && --idleDelay == 0)
|
||||||
DefaultAnimation.PlayThen(idleSequence, () =>
|
|
||||||
{
|
{
|
||||||
DefaultAnimation.PlayRepeating(NormalizeInfantrySequence(self, info.StandAnimations.Random(Game.CosmeticRandom)));
|
state = AnimationState.IdleAnimating;
|
||||||
state = AnimationState.Waiting;
|
DefaultAnimation.PlayThen(idleSequence, () =>
|
||||||
});
|
{
|
||||||
|
DefaultAnimation.PlayRepeating(NormalizeInfantrySequence(self, info.StandAnimations.Random(Game.CosmeticRandom)));
|
||||||
|
state = AnimationState.Waiting;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DefaultAnimation.PlayRepeating(NormalizeInfantrySequence(self, info.StandAnimations.Random(Game.CosmeticRandom)));
|
||||||
|
state = AnimationState.Waiting;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user