allow to set the recipe already for construction sites
This commit is contained in:
@@ -88,12 +88,12 @@ QString shipTooltip(const ShipDef& def)
|
||||
} // namespace
|
||||
|
||||
std::vector<RecipeSelectionOption> buildRecipeSelectionOptions(
|
||||
const Building& building, Simulation& sim, const GameConfig& config)
|
||||
BuildingType type, Simulation& sim, const GameConfig& config)
|
||||
{
|
||||
std::vector<RecipeSelectionOption> options;
|
||||
options.push_back({std::string(), QObject::tr("(None)"), QString()});
|
||||
|
||||
if (building.type == BuildingType::Shipyard)
|
||||
if (type == BuildingType::Shipyard)
|
||||
{
|
||||
for (const ShipDef& def : config.ships.ships)
|
||||
{
|
||||
@@ -107,9 +107,9 @@ std::vector<RecipeSelectionOption> buildRecipeSelectionOptions(
|
||||
{
|
||||
for (const RecipeDef& recipe : config.recipes.recipes)
|
||||
{
|
||||
if (recipe.building != building.type) { continue; }
|
||||
if ((building.type == BuildingType::Miner
|
||||
|| building.type == BuildingType::Assembler)
|
||||
if (recipe.building != type) { continue; }
|
||||
if ((type == BuildingType::Miner
|
||||
|| type == BuildingType::Assembler)
|
||||
&& !sim.isRecipeUnlocked(recipe.id))
|
||||
{
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user