diff --git a/OpenRA.Mods.RA/Render/RenderUnit.cs b/OpenRA.Mods.RA/Render/RenderUnit.cs index 6bbd6f9dc1..6ed16ac5d3 100644 --- a/OpenRA.Mods.RA/Render/RenderUnit.cs +++ b/OpenRA.Mods.RA/Render/RenderUnit.cs @@ -16,6 +16,7 @@ namespace OpenRA.Mods.RA.Render { public class RenderUnitInfo : RenderSimpleInfo { + public readonly bool Smokes = true; public override object Create(ActorInitializer init) { return new RenderUnit(init.self); } } @@ -24,8 +25,12 @@ namespace OpenRA.Mods.RA.Render public RenderUnit(Actor self) : base(self, () => self.HasTrait() ? self.Trait().Facing : 0) { + canSmoke = self.Info.Traits.Get().Smokes; + anim.Play("idle"); - anims.Add( "smoke", new AnimationWithOffset( new Animation( "smoke_m" ), null, () => !isSmoking ) ); + + if (canSmoke) + anims.Add( "smoke", new AnimationWithOffset( new Animation( "smoke_m" ), null, () => !isSmoking ) ); } public void PlayCustomAnimation(Actor self, string newAnim, Action after) @@ -34,11 +39,12 @@ namespace OpenRA.Mods.RA.Render } bool isSmoking; + bool canSmoke; public void Damaged(Actor self, AttackInfo e) { if (e.DamageState < DamageState.Heavy) return; - if (isSmoking) return; + if (isSmoking || !canSmoke) return; isSmoking = true; var smoke = anims[ "smoke" ].Animation;