From ce69ea2237447678d26d84daab9bd599f15f5b8b Mon Sep 17 00:00:00 2001 From: Squiggles211 Date: Mon, 12 May 2014 08:42:44 -0500 Subject: [PATCH] Fix sold tech bug on build limited structures Fixes where if a structure with a build limit was sold, it was not properly removed from the buildables prerequisite list until next update. --- OpenRA.Mods.RA/Player/TechTree.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/OpenRA.Mods.RA/Player/TechTree.cs b/OpenRA.Mods.RA/Player/TechTree.cs index a320713820..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)); @@ -114,7 +114,6 @@ namespace OpenRA.Mods.RA public void Update(Cache> buildables) { var hasReachedBuildLimit = buildLimit > 0 && buildables.Keys.Contains(Key) && buildables[Key].Count >= buildLimit; - var nowHasPrerequisites = HasPrerequisites(buildables) && !hasReachedBuildLimit; if (nowHasPrerequisites && !hasPrerequisites)