Fix TechTree prerequisite bug for buildings with a build limit.
Fixes where a building/unit whose prereq is a build limited structure was always available to be built even when the prereq was not satisfied.
This commit is contained in:
@@ -113,7 +113,11 @@ namespace OpenRA.Mods.RA
|
|||||||
|
|
||||||
public void Update(Cache<string, List<Actor>> buildables)
|
public void Update(Cache<string, List<Actor>> buildables)
|
||||||
{
|
{
|
||||||
var hasReachedBuildLimit = buildLimit > 0 && buildables[Key].Count >= buildLimit;
|
var hasReachedBuildLimit = false;
|
||||||
|
|
||||||
|
if(buildables.Keys.Contains(Key))
|
||||||
|
hasReachedBuildLimit = buildLimit > 0 && buildables[Key].Count >= buildLimit;
|
||||||
|
|
||||||
var nowHasPrerequisites = HasPrerequisites(buildables) && !hasReachedBuildLimit;
|
var nowHasPrerequisites = HasPrerequisites(buildables) && !hasReachedBuildLimit;
|
||||||
|
|
||||||
if (nowHasPrerequisites && !hasPrerequisites)
|
if (nowHasPrerequisites && !hasPrerequisites)
|
||||||
|
|||||||
Reference in New Issue
Block a user