Fix station docking bays, save-safe instance keys, and zero-weight draws

One rule now governs interior space: an empty hardpoint cell is usable, in
both UnoccupiedSpace and ItemFits. ItemFits used to refuse hardpoint cells
that UnoccupiedSpace offered, so stations failed to equip a docking bay.

CraftedItemInstance.Ingredients and Product move from keys 3 and 4 to 9 and
10, past every key the derived instances use. At 3 and 4 an older save reads
nil into a non-nullable Guid and fails to load.

WeightedRandomElements returns an empty array when every weight is zero,
instead of an array of nulls. LoadoutGenerator treats a missing Galaxy as
"every product available", the seam a fixture needs to generate loadouts
without a galaxy. ZoneGenerator skips a story station that fails to generate
and logs it, instead of throwing.

Verified: Aetheria.Shared and tools/AetherDb build headless; Unity 6000.3.24f1
batchmode compile succeeds; AetherDb doctor, station-fit and loadout pass.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-09-12 23:22:36 +02:00
commit 6bd3e17690
5 changed files with 25 additions and 12 deletions

View file

@ -37,12 +37,16 @@ public abstract class CraftedItemInstance : ItemInstance
// The workmanship of this particular unit, as distinct from the parts that went into it.
[JsonProperty("quality"), Key(2)] public float Quality;
// The part filling each of the design's roles, one level deep. Empty on items made before roles existed,
// and on parts themselves; stats then read Quality as they always did.
[JsonProperty("ingredients"), Key(3)] public List<RoleFill> Ingredients = new List<RoleFill>();
// Keys 9 and 10, past every key the derived instances use: an item saved before these existed has no
// element there at all. Keys 3 to 6 sit inside the old range and read back as nil, which a non-nullable
// Guid cannot deserialize, so nothing new may go there.
// How good the part filling each of the design's roles turned out. Empty on items made before roles
// existed; stats then read Quality as they always did.
[JsonProperty("ingredients"), Key(9)] public List<RoleFill> Ingredients = new List<RoleFill>();
// The manufacturer's branded product this was built as, naming it and carrying its flavor text.
[JsonProperty("product"), Key(4)] public Guid Product;
[JsonProperty("product"), Key(10)] public Guid Product;
// The quality a stat reads for one of the design's roles. An unnamed role, a design without roles, and an
// item built before roles existed all fall back to this item's own workmanship.