diff --git a/src/TechTree.cpp b/src/TechTree.cpp index 62df02425088577508c09cc53ee09220a3d189ee..576ec8804ebb367e9115babdc31fee148e61fefc 100644 --- a/src/TechTree.cpp +++ b/src/TechTree.cpp @@ -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;