From d26b465e9ad19aaa1e3ee6d2a4bc40b483f80c57 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 10 Oct 2026 15:49:26 +0200 Subject: [PATCH] consumables-first-set command: public with a root argument, as the other catalog commands (tests drive it on a scratch catalog) Settings are read from the opened db's root, not the working directory. Builds. Co-Authored-By: Claude Opus 5.5 --- tools/AetherDb/Program.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/AetherDb/Program.cs b/tools/AetherDb/Program.cs index ba497376b..d5b633412 100644 --- a/tools/AetherDb/Program.cs +++ b/tools/AetherDb/Program.cs @@ -1953,9 +1953,9 @@ public static class Program // the catalog's 1x1 tool; mass, price, shape and every effect are authored here. The vent's cloud encloses the // largest hull (the Djinni) at its minimum radius: half the hull's diagonal in zone units, times 1.5. Dry run // unless passed "apply". - private static int ConsumablesFirstSetCatalog(bool apply) + public static int ConsumablesFirstSetCatalog(bool apply, string root = null) { - var db = AetherDb.Open(catalogWritable: apply); + var db = AetherDb.Open(catalogWritable: apply, root: root); var designNames = new[] { "Thruster Overdrive", "Coolant Vent" }; var already = designNames.Count(name => db.Cache.GetAll().Any(c => c.Name == name)); if (already == designNames.Length) @@ -1967,7 +1967,7 @@ public static class Program var template = db.Cache.GetAll().Single(g => g.Name == "Targeting Computer"); var djinni = db.Cache.GetAll().Single(h => h.Name == "Djinni"); - var cellSize = AuthoredSettings.Load(AetherDb.FindRoot()).Read("GameplaySettings").SchematicCellSize; + var cellSize = AuthoredSettings.Load(db.Root).Read("GameplaySettings").SchematicCellSize; var halfDiagonal = .5f * cellSize * MathF.Sqrt(djinni.Shape.Width * djinni.Shape.Width + djinni.Shape.Height * djinni.Shape.Height); var radiusMin = 1.5f * halfDiagonal;