implement storing recipes in blueprint
This commit is contained in:
@@ -472,7 +472,20 @@ void GameWorldView::placeBlueprintAtTile(QPoint center)
|
||||
|
||||
for (const BlueprintBuilding& bb : bp.buildings)
|
||||
{
|
||||
m_sim->tryPlaceBuilding(bb.type, center + bb.offset, bb.rotation);
|
||||
const EntityId id = m_sim->tryPlaceBuilding(bb.type, center + bb.offset, bb.rotation);
|
||||
if (id == kInvalidEntityId || bb.recipeId.empty()) { continue; }
|
||||
|
||||
if (bb.type == BuildingType::Shipyard)
|
||||
{
|
||||
if (m_sim->isSchematicUnlocked(bb.recipeId))
|
||||
{
|
||||
m_sim->buildings().setRecipe(id, bb.recipeId);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_sim->buildings().setRecipe(id, bb.recipeId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user