Merge pull request #10141 from reaperrr/fix-anim-cancel
Fix actors not going back to idle animation after custom animation
This commit is contained in:
@@ -48,7 +48,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
if (--ticks <= 0)
|
||||
{
|
||||
if (!(info.PauseOnLowPower && self.IsDisabled()))
|
||||
wsb.PlayCustomAnimation(self, info.Sequence);
|
||||
wsb.PlayCustomAnimation(self, info.Sequence, () => wsb.CancelCustomAnimation(self));
|
||||
ticks = info.Interval;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
public void Charging(Actor self, Target target)
|
||||
{
|
||||
wsb.PlayCustomAnimation(self, info.ChargeSequence);
|
||||
wsb.PlayCustomAnimation(self, info.ChargeSequence, () => wsb.CancelCustomAnimation(self));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
var spriteBody = host.TraitOrDefault<WithSpriteBody>();
|
||||
if (spriteBody != null && !(info.PauseOnLowPower && self.IsDisabled()))
|
||||
spriteBody.PlayCustomAnimation(host, info.Sequence);
|
||||
spriteBody.PlayCustomAnimation(host, info.Sequence, () => spriteBody.CancelCustomAnimation(self));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user