Skip to content
Snippets Groups Projects
Commit 98b42d2c authored by David Bergström's avatar David Bergström
Browse files

Only empty TechTree when there exists a BuildDescription

parent 4405a9d1
Branches
Tags
No related merge requests found
......@@ -31,13 +31,18 @@ void TechTree::onStart()
{
TypeData & data = pair.second;
const std::vector<BuildDescription> & howToBuild = tree.HowToBuild(pair.first.getAPIUnitType());
if (howToBuild.empty())
{
continue;
}
data.whatBuilds.clear();
data.requiredUnits.clear();
// TODO: Support for upgrades, is it possible via JSON? Is the hard coded information correct?
data.requiredUpgrades.clear();
const std::vector<BuildDescription> & howToBuild = tree.HowToBuild(pair.first.getAPIUnitType());
for (const BuildDescription & description : howToBuild)
{
data.whatBuilds.push_back(UnitType(description.producer_type, m_bot));
......@@ -63,7 +68,6 @@ void TechTree::onStart()
data.requiredUnits.clear();
data.requiredUpgrades.clear();
for (const ResearchDescription & description : tree.HowToResearch(id))
{
data.buildAbility = description.ability_used;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment