diff --git a/OpenRA.Mods.Common/Traits/Render/WithAttackAnimation.cs b/OpenRA.Mods.Common/Traits/Render/WithAttackAnimation.cs index 1947b2e517..f9bd668e65 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithAttackAnimation.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithAttackAnimation.cs @@ -75,8 +75,7 @@ namespace OpenRA.Mods.Common.Traits.Render if (!IsTraitDisabled && !wsb.IsTraitDisabled && !string.IsNullOrEmpty(Info.AttackSequence)) { attackAnimPlaying = true; - wsb.PlayCustomAnimation(self, Info.AttackSequence, - () => { wsb.CancelCustomAnimation(self); attackAnimPlaying = false; }); + wsb.PlayCustomAnimation(self, Info.AttackSequence, () => attackAnimPlaying = false); } } diff --git a/OpenRA.Mods.Common/Traits/Render/WithBuildingPlacedAnimation.cs b/OpenRA.Mods.Common/Traits/Render/WithBuildingPlacedAnimation.cs index b69153a4aa..2470504d8f 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithBuildingPlacedAnimation.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithBuildingPlacedAnimation.cs @@ -57,7 +57,7 @@ namespace OpenRA.Mods.Common.Traits.Render void INotifyBuildingPlaced.BuildingPlaced(Actor self) { if (buildComplete) - wsb.PlayCustomAnimation(self, info.Sequence, () => wsb.CancelCustomAnimation(self)); + wsb.PlayCustomAnimation(self, info.Sequence); } } } \ No newline at end of file diff --git a/OpenRA.Mods.Common/Traits/Render/WithIdleAnimation.cs b/OpenRA.Mods.Common/Traits/Render/WithIdleAnimation.cs index c96553387c..9b9d6cb2b8 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithIdleAnimation.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithIdleAnimation.cs @@ -45,7 +45,7 @@ namespace OpenRA.Mods.Common.Traits.Render if (--ticks <= 0) { - wsb.PlayCustomAnimation(self, Info.Sequences.Random(Game.CosmeticRandom), () => wsb.CancelCustomAnimation(self)); + wsb.PlayCustomAnimation(self, Info.Sequences.Random(Game.CosmeticRandom)); ticks = Info.Interval; } } diff --git a/OpenRA.Mods.Common/Traits/Render/WithRearmAnimation.cs b/OpenRA.Mods.Common/Traits/Render/WithRearmAnimation.cs index e3b4a79cf4..6f2de78ac8 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithRearmAnimation.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithRearmAnimation.cs @@ -36,7 +36,7 @@ namespace OpenRA.Mods.Common.Traits.Render void INotifyRearm.Rearming(Actor self, Actor target) { if (buildComplete && spriteBody != null && !IsTraitDisabled) - spriteBody.PlayCustomAnimation(self, Info.Sequence, () => spriteBody.CancelCustomAnimation(self)); + spriteBody.PlayCustomAnimation(self, Info.Sequence); } void INotifyBuildComplete.BuildingComplete(Actor self) diff --git a/OpenRA.Mods.Common/Traits/Render/WithRepairAnimation.cs b/OpenRA.Mods.Common/Traits/Render/WithRepairAnimation.cs index f9de5e9e49..7efbaadb0e 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithRepairAnimation.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithRepairAnimation.cs @@ -36,7 +36,7 @@ namespace OpenRA.Mods.Common.Traits.Render void INotifyRepair.Repairing(Actor self, Actor target) { if (buildComplete && spriteBody != null && !IsTraitDisabled) - spriteBody.PlayCustomAnimation(self, Info.Sequence, () => spriteBody.CancelCustomAnimation(self)); + spriteBody.PlayCustomAnimation(self, Info.Sequence); } void INotifyBuildComplete.BuildingComplete(Actor self) diff --git a/OpenRA.Mods.Common/Traits/Render/WithSpriteBody.cs b/OpenRA.Mods.Common/Traits/Render/WithSpriteBody.cs index 9024f98739..519f2b76c2 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithSpriteBody.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithSpriteBody.cs @@ -93,7 +93,7 @@ namespace OpenRA.Mods.Common.Traits.Render { DefaultAnimation.PlayThen(NormalizeSequence(self, name), () => { - DefaultAnimation.Play(NormalizeSequence(self, Info.Sequence)); + CancelCustomAnimation(self); if (after != null) after(); }); @@ -109,7 +109,7 @@ namespace OpenRA.Mods.Common.Traits.Render { DefaultAnimation.PlayBackwardsThen(NormalizeSequence(self, name), () => { - DefaultAnimation.PlayRepeating(NormalizeSequence(self, Info.Sequence)); + CancelCustomAnimation(self); if (after != null) after(); }); diff --git a/OpenRA.Mods.Common/Traits/SupportPowers/GrantExternalConditionPower.cs b/OpenRA.Mods.Common/Traits/SupportPowers/GrantExternalConditionPower.cs index f8f70c3600..eef1ea4196 100644 --- a/OpenRA.Mods.Common/Traits/SupportPowers/GrantExternalConditionPower.cs +++ b/OpenRA.Mods.Common/Traits/SupportPowers/GrantExternalConditionPower.cs @@ -63,7 +63,7 @@ namespace OpenRA.Mods.Common.Traits var wsb = self.TraitOrDefault(); if (wsb != null && wsb.DefaultAnimation.HasSequence(info.Sequence)) - wsb.PlayCustomAnimation(self, info.Sequence, () => wsb.CancelCustomAnimation(self)); + wsb.PlayCustomAnimation(self, info.Sequence); Game.Sound.Play(SoundType.World, info.OnFireSound, self.World.Map.CenterOfCell(order.TargetLocation)); diff --git a/OpenRA.Mods.Common/Traits/SupportPowers/NukePower.cs b/OpenRA.Mods.Common/Traits/SupportPowers/NukePower.cs index 7fec41b2f3..44dd936059 100644 --- a/OpenRA.Mods.Common/Traits/SupportPowers/NukePower.cs +++ b/OpenRA.Mods.Common/Traits/SupportPowers/NukePower.cs @@ -106,7 +106,7 @@ namespace OpenRA.Mods.Common.Traits if (!string.IsNullOrEmpty(info.ActivationSequence)) { var wsb = self.Trait(); - wsb.PlayCustomAnimation(self, info.ActivationSequence, () => wsb.CancelCustomAnimation(self)); + wsb.PlayCustomAnimation(self, info.ActivationSequence); } var targetPosition = self.World.Map.CenterOfCell(order.TargetLocation);