diff --git a/OpenRA.Mods.Common/Traits/Render/WithMuzzleFlash.cs b/OpenRA.Mods.Common/Traits/Render/WithMuzzleFlash.cs index 8e8a4eea81..253739ce95 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithMuzzleFlash.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithMuzzleFlash.cs @@ -17,7 +17,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { [Desc("Renders the MuzzleSequence from the Armament trait.")] - class WithMuzzleFlashInfo : ITraitInfo, Requires, Requires, Requires + class WithMuzzleFlashInfo : UpgradableTraitInfo, ITraitInfo, Requires, Requires, Requires { [Desc("Ignore the weapon position, and always draw relative to the center of the actor")] public readonly bool IgnoreOffset = false; @@ -25,13 +25,14 @@ namespace OpenRA.Mods.Common.Traits public object Create(ActorInitializer init) { return new WithMuzzleFlash(init.Self, this); } } - class WithMuzzleFlash : INotifyAttack, IRender, ITick + class WithMuzzleFlash : UpgradableTrait, INotifyAttack, IRender, ITick { Dictionary visible = new Dictionary(); Dictionary anims = new Dictionary(); Func getFacing; public WithMuzzleFlash(Actor self, WithMuzzleFlashInfo info) + : base(info) { var render = self.Trait(); var facing = self.TraitOrDefault(); @@ -64,7 +65,7 @@ namespace OpenRA.Mods.Common.Traits anims.Add(barrel, new AnimationWithOffset(muzzleFlash, () => info.IgnoreOffset ? WVec.Zero : armClosure.MuzzleOffset(self, barrel), - () => !visible[barrel], + () => IsTraitDisabled || !visible[barrel], () => false, p => WithTurret.ZOffsetFromCenter(self, p, 2))); }