diff --git a/OpenRA.Mods.Common/Traits/Player/ProductionQueue.cs b/OpenRA.Mods.Common/Traits/Player/ProductionQueue.cs index ca4642bec4..09df74d13d 100644 --- a/OpenRA.Mods.Common/Traits/Player/ProductionQueue.cs +++ b/OpenRA.Mods.Common/Traits/Player/ProductionQueue.cs @@ -412,8 +412,11 @@ namespace OpenRA.Mods.Common.Traits var hasPlayedSound = false; BeginProduction(new ProductionItem(this, order.TargetString, cost, playerPower, () => self.World.AddFrameEndTask(_ => { - var isBuilding = unit.HasTraitInfo(); + // Make sure the item hasn't been invalidated between the ProductionItem ticking and this FrameEndTask running + if (!Queue.Any(i => i.Done && i.Item == unit.Name)) + return; + var isBuilding = unit.HasTraitInfo(); if (isBuilding && !hasPlayedSound) hasPlayedSound = Game.Sound.PlayNotification(rules, self.Owner, "Speech", Info.ReadyAudio, self.Owner.Faction.InternalName); else if (!isBuilding)