diff --git a/OpenRA.Mods.RA/Player/TechTree.cs b/OpenRA.Mods.RA/Player/TechTree.cs index 4e85d0e8bc..a90ee60602 100755 --- a/OpenRA.Mods.RA/Player/TechTree.cs +++ b/OpenRA.Mods.RA/Player/TechTree.cs @@ -80,7 +80,7 @@ namespace OpenRA.Mods.RA // Add buildables that have a build limit set and are not already in the list player.World.ActorsWithTrait() - .Where(a => a.Actor.Info.Traits.Get().BuildLimit > 0 && !a.Actor.IsDead() && a.Actor.Owner == player && ret.Keys.All(k => k != a.Actor.Info.Name)) + .Where(a => a.Actor.Info.Traits.Get().BuildLimit > 0 && !a.Actor.IsDead() && a.Actor.IsInWorld && a.Actor.Owner == player && ret.Keys.All(k => k != a.Actor.Info.Name)) .ToList() .ForEach(b => ret[b.Actor.Info.Name].Add(b.Actor)); @@ -113,7 +113,7 @@ namespace OpenRA.Mods.RA public void Update(Cache> buildables) { - var hasReachedBuildLimit = buildLimit > 0 && buildables[Key].Count >= buildLimit; + var hasReachedBuildLimit = buildLimit > 0 && buildables.Keys.Contains(Key) && buildables[Key].Count >= buildLimit; var nowHasPrerequisites = HasPrerequisites(buildables) && !hasReachedBuildLimit; if (nowHasPrerequisites && !hasPrerequisites)