diff --git a/OpenRA.Mods.Common/Activities/Rearm.cs b/OpenRA.Mods.Common/Activities/Rearm.cs index 0a09b3f548..ce522189bd 100644 --- a/OpenRA.Mods.Common/Activities/Rearm.cs +++ b/OpenRA.Mods.Common/Activities/Rearm.cs @@ -59,7 +59,7 @@ namespace OpenRA.Mods.Common.Activities var wsb = hostBuilding.Trait(); if (wsb.DefaultAnimation.HasSequence("active")) - wsb.PlayCustomAnimation(hostBuilding, "active"); + wsb.PlayCustomAnimation(hostBuilding, "active", () => wsb.CancelCustomAnimation(self)); var sound = pool.Info.RearmSound; if (sound != null) diff --git a/OpenRA.Mods.Common/Traits/Buildings/Refinery.cs b/OpenRA.Mods.Common/Traits/Buildings/Refinery.cs index 8f68e05901..e1d33418da 100644 --- a/OpenRA.Mods.Common/Traits/Buildings/Refinery.cs +++ b/OpenRA.Mods.Common/Traits/Buildings/Refinery.cs @@ -107,7 +107,7 @@ namespace OpenRA.Mods.Common.Traits // Harvester was killed while unloading if (dockedHarv != null && dockedHarv.IsDead) { - wsb.PlayCustomAnimation(self, wsb.Info.Sequence); + wsb.CancelCustomAnimation(self); dockedHarv = null; } diff --git a/OpenRA.Mods.Common/Traits/Render/WithActiveAnimation.cs b/OpenRA.Mods.Common/Traits/Render/WithActiveAnimation.cs index 2357568be9..22d17f6eda 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithActiveAnimation.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithActiveAnimation.cs @@ -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; } } diff --git a/OpenRA.Mods.Common/Traits/Render/WithChargeAnimation.cs b/OpenRA.Mods.Common/Traits/Render/WithChargeAnimation.cs index b48b9733d2..6adc0e074d 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithChargeAnimation.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithChargeAnimation.cs @@ -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)); } } } diff --git a/OpenRA.Mods.Common/Traits/Render/WithRepairAnimation.cs b/OpenRA.Mods.Common/Traits/Render/WithRepairAnimation.cs index 5aa6b86d39..ca9027c678 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithRepairAnimation.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithRepairAnimation.cs @@ -38,7 +38,7 @@ namespace OpenRA.Mods.Common.Traits { var spriteBody = host.TraitOrDefault(); if (spriteBody != null && !(info.PauseOnLowPower && self.IsDisabled())) - spriteBody.PlayCustomAnimation(host, info.Sequence); + spriteBody.PlayCustomAnimation(host, info.Sequence, () => spriteBody.CancelCustomAnimation(self)); } } } \ No newline at end of file diff --git a/OpenRA.Mods.Common/Traits/SupportPowers/GrantUpgradePower.cs b/OpenRA.Mods.Common/Traits/SupportPowers/GrantUpgradePower.cs index 71e16651e0..c796400af8 100644 --- a/OpenRA.Mods.Common/Traits/SupportPowers/GrantUpgradePower.cs +++ b/OpenRA.Mods.Common/Traits/SupportPowers/GrantUpgradePower.cs @@ -59,7 +59,7 @@ namespace OpenRA.Mods.Common.Traits var wsb = self.TraitOrDefault(); if (wsb != null && wsb.DefaultAnimation.HasSequence(info.GrantUpgradeSequence)) - wsb.PlayCustomAnimation(self, info.GrantUpgradeSequence); + wsb.PlayCustomAnimation(self, info.GrantUpgradeSequence, () => wsb.CancelCustomAnimation(self)); Game.Sound.Play(info.GrantUpgradeSound, 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 5559a7d6fb..cf9bd82482 100644 --- a/OpenRA.Mods.Common/Traits/SupportPowers/NukePower.cs +++ b/OpenRA.Mods.Common/Traits/SupportPowers/NukePower.cs @@ -82,7 +82,7 @@ namespace OpenRA.Mods.Common.Traits if (!string.IsNullOrEmpty(info.ActivationSequence)) { var wsb = self.Trait(); - wsb.PlayCustomAnimation(self, info.ActivationSequence); + wsb.PlayCustomAnimation(self, info.ActivationSequence, () => wsb.CancelCustomAnimation(self)); } var targetPosition = self.World.Map.CenterOfCell(order.TargetLocation);