diff --git a/OpenRA.Mods.Common/Traits/Render/WithDecoration.cs b/OpenRA.Mods.Common/Traits/Render/WithDecoration.cs index 850ac087c1..7a3c33b6cf 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithDecoration.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithDecoration.cs @@ -10,6 +10,7 @@ using System; using System.Collections.Generic; +using System.Linq; using OpenRA.Graphics; using OpenRA.Traits; @@ -87,27 +88,27 @@ namespace OpenRA.Mods.Common.Traits public IEnumerable Render(Actor self, WorldRenderer wr) { if (IsTraitDisabled) - yield break; + return Enumerable.Empty(); if (self.IsDead || !self.IsInWorld) - yield break; + return Enumerable.Empty(); if (anim == null) - yield break; + return Enumerable.Empty(); var allied = self.Owner.IsAlliedWith(self.World.RenderPlayer); if (!allied && !info.ShowToEnemies) - yield break; + return Enumerable.Empty(); if (allied && !info.ShowToAllies) - yield break; + return Enumerable.Empty(); if (!ShouldRender(self)) - yield break; + return Enumerable.Empty(); if (self.World.FogObscures(self)) - yield break; + return Enumerable.Empty(); var pxPos = wr.ScreenPxPosition(self.CenterPosition); var actorBounds = self.Bounds; @@ -150,7 +151,7 @@ namespace OpenRA.Mods.Common.Traits anim.Tick(); - yield return new SpriteRenderable(img, renderPos, WVec.Zero, info.ZOffset, wr.Palette(info.Palette), info.Scale, true); + return new IRenderable[] { new SpriteRenderable(img, renderPos, WVec.Zero, info.ZOffset, wr.Palette(info.Palette), info.Scale, true) }; } } }