Lot moves to ItemInstance at key 11; stacks merge, split, restore and root by lot

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Nibu 2026-11-13 03:00:44 +00:00
commit 00a036427d
5 changed files with 16 additions and 12 deletions

View file

@ -24,6 +24,11 @@ public abstract class ItemInstance
{
[JsonProperty("data"), Key(0)] public CultRecordRef<ItemData> Data;
[JsonProperty("rotation"), Key(1)] public ItemRotation Rotation;
// The lot this unit was minted or mined from: crafted units' design, provenance, workmanship and role fills all
// live there; a mined SimpleCommodity names its Extracted lot (zone, belt, ore). Lot 0 is no lot: bought, staged
// and loadout commodities, and every save from before the field reached SimpleCommodity.
[JsonProperty("lot"), Key(11)] public int Lot;
}
[Union(0, typeof(CompoundCommodity)),
@ -33,9 +38,7 @@ public abstract class ItemInstance
public abstract class CraftedItemInstance : ItemInstance
{
// Keys 2 (Quality), 9 (Ingredients) and 10 (Product) belonged to fields moved to Lot; do not reuse them.
// The lot this unit was minted from: its design, provenance, workmanship and role fills all live there.
[JsonProperty("lot"), Key(11)] public int Lot;
// Key 11 (Lot) lives on ItemInstance.
}
[MessagePackObject, JsonObject(MemberSerialization.OptIn)]