diff --git a/OpenRA.Mods.Common/Traits/Render/WithProductionOverlay.cs b/OpenRA.Mods.Common/Traits/Render/WithProductionOverlay.cs index f019c3f6e1..7373b377eb 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithProductionOverlay.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithProductionOverlay.cs @@ -42,7 +42,7 @@ namespace OpenRA.Mods.Common.Traits.Render public class WithProductionOverlay : PausableConditionalTrait, INotifyDamageStateChanged, INotifyCreated, INotifyOwnerChanged { readonly Animation overlay; - readonly ProductionInfo production; + readonly ProductionInfo[] productionInfos; ProductionQueue[] queues; bool IsProducing @@ -56,7 +56,7 @@ namespace OpenRA.Mods.Common.Traits.Render var rs = self.Trait(); var body = self.Trait(); - production = self.Info.TraitInfo(); + productionInfos = self.Info.TraitInfos().ToArray(); overlay = new Animation(self.World, rs.GetImage(self), () => IsTraitPaused); overlay.PlayRepeating(info.Sequence); @@ -72,7 +72,7 @@ namespace OpenRA.Mods.Common.Traits.Render { // Per-actor production queues = self.TraitsImplementing() - .Where(q => production.Produces.Contains(q.Info.Type)) + .Where(q => productionInfos.Any(p => p.Produces.Contains(q.Info.Type))) .Where(q => !Info.Queues.Any() || Info.Queues.Contains(q.Info.Type)) .ToArray(); @@ -80,7 +80,7 @@ namespace OpenRA.Mods.Common.Traits.Render { // Player-wide production queues = self.Owner.PlayerActor.TraitsImplementing() - .Where(q => production.Produces.Contains(q.Info.Type)) + .Where(q => productionInfos.Any(p => p.Produces.Contains(q.Info.Type))) .Where(q => !Info.Queues.Any() || Info.Queues.Contains(q.Info.Type)) .ToArray(); }