diff --git a/OpenRA.Mods.Common/Traits/Crushable.cs b/OpenRA.Mods.Common/Traits/Crushable.cs index 48fe759911..5a4dd71c7b 100644 --- a/OpenRA.Mods.Common/Traits/Crushable.cs +++ b/OpenRA.Mods.Common/Traits/Crushable.cs @@ -57,17 +57,6 @@ namespace OpenRA.Mods.Common.Traits Game.Sound.Play(info.CrushSound, crusher.CenterPosition); - var wda = self.TraitsImplementing() - .FirstOrDefault(s => s.Info.CrushedSequence != null); - if (wda != null) - { - var palette = wda.Info.CrushedSequencePalette; - if (wda.Info.CrushedPaletteIsPlayerPalette) - palette += self.Owner.InternalName; - - wda.SpawnDeathAnimation(self, wda.Info.CrushedSequence, palette); - } - self.Kill(crusher); } diff --git a/OpenRA.Mods.Common/Traits/Render/WithDeathAnimation.cs b/OpenRA.Mods.Common/Traits/Render/WithDeathAnimation.cs index 9298f1bd85..50333feb47 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithDeathAnimation.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithDeathAnimation.cs @@ -117,6 +117,15 @@ namespace OpenRA.Mods.Common.Traits void INotifyCrushed.OnCrush(Actor self, Actor crusher, HashSet crushClasses) { crushed = true; + + if (Info.CrushedSequence == null) + return; + + var crushPalette = Info.CrushedSequencePalette; + if (Info.CrushedPaletteIsPlayerPalette) + crushPalette += self.Owner.InternalName; + + SpawnDeathAnimation(self, Info.CrushedSequence, crushPalette); } void INotifyCrushed.WarnCrush(Actor self, Actor crusher, HashSet crushClasses) { }