allow to configure when which schematic gets unlockable
This commit is contained in:
@@ -654,7 +654,7 @@ TEST_CASE("Blueprint placement: recipe transfers to building after construction
|
||||
|
||||
TEST_CASE("Blueprint placement: interceptor schematic is unlocked at game start", "[blueprint]")
|
||||
{
|
||||
// "interceptor" has available_from_start = true in the test config.
|
||||
// "interceptor" has unlock_at_station_level = -1 in the test config.
|
||||
// This confirms the guard in placeBlueprintAtTile passes for start-unlocked schematics.
|
||||
Simulation sim(loadConfig());
|
||||
REQUIRE(sim.isSchematicUnlocked("interceptor"));
|
||||
@@ -662,7 +662,7 @@ TEST_CASE("Blueprint placement: interceptor schematic is unlocked at game start"
|
||||
|
||||
TEST_CASE("Blueprint placement: repair_ship schematic is locked at game start", "[blueprint]")
|
||||
{
|
||||
// "repair_ship" has available_from_start = false in the test config.
|
||||
// "repair_ship" has unlock_at_station_level = 0 in the test config.
|
||||
// This confirms the guard in placeBlueprintAtTile blocks locked schematics,
|
||||
// leaving the shipyard's schematic unset.
|
||||
Simulation sim(loadConfig());
|
||||
|
||||
@@ -23,7 +23,7 @@ static const ShipDef* findAvailableSchematic(const GameConfig& cfg)
|
||||
{
|
||||
for (const ShipDef& def : cfg.ships.ships)
|
||||
{
|
||||
if (def.availableFromStart && !def.schematic.materials.empty())
|
||||
if (def.unlockAtStationLevel == -1 && !def.schematic.materials.empty())
|
||||
{
|
||||
return &def;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user