From c896489b39336c6f5630c8546daee7e964b53b2e Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 19 Sep 2026 18:56:53 +0200 Subject: [PATCH] Fix the merge of Cuts 6b and 6c: a new float field made the catalog unreadable Cut 6b added WeaponItemData.AirburstRange as a non-nullable float at Key(29). Every WeaponItemData record in GameData/Aetheria.cc was serialized before that key existed, so the reader is handed nil for the absent slot and a float cannot take nil -- AetheriaStores.Open threw MessagePackSerializationException and the game could not read its own catalog. AirburstRange becomes float?, null meaning no authored burst radius, which is also the more honest reading of a value no product sets yet. Neither cut could have caught this alone. 6b verified with unit tests over synthetic fixtures and never opened the shipped catalog; 6c opened the catalog constantly but on a branch without the new field. It appears only in the merge, and only when something actually reads GameData. The general rule, which will recur: a new non-nullable value-type field on a persisted CultCache document cannot read records written before it existed. Nullable, or a migration that rewrites every affected record -- and a migration cannot run if the read already throws, so tolerant deserialization comes first. Verified on the merged tree: catalog reads (53 designs, 47 products), 0 dangling refs, 215 tests pass, and loadout with all three targeting sellers excluded generates every hull with 1 armed hull falling back to unaided fire. Co-Authored-By: Claude Opus 5 --- Assets/Scripts/ServerShared/FireControl.cs | 2 +- Assets/Scripts/ServerShared/ItemData.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/ServerShared/FireControl.cs b/Assets/Scripts/ServerShared/FireControl.cs index 2d9698b5d..214f0bc2d 100644 --- a/Assets/Scripts/ServerShared/FireControl.cs +++ b/Assets/Scripts/ServerShared/FireControl.cs @@ -210,7 +210,7 @@ public static class FireControl var weaponItemData = item.Data as WeaponItemData; var isAirburst = weaponItemData != null && weaponItemData.WeaponModifiers.HasFlag(WeaponModifiers.Airburst); var burstPosition = isAirburst && target != null ? PredictedIntercept(weapon, source, target) : targetPosition; - var burstRadius = isAirburst ? weaponItemData.AirburstRange : 0f; + var burstRadius = isAirburst ? weaponItemData.AirburstRange ?? 0f : 0f; var shot = new PendingShot { diff --git a/Assets/Scripts/ServerShared/ItemData.cs b/Assets/Scripts/ServerShared/ItemData.cs index 384edf728..1cec438cc 100644 --- a/Assets/Scripts/ServerShared/ItemData.cs +++ b/Assets/Scripts/ServerShared/ItemData.cs @@ -495,7 +495,7 @@ public class WeaponItemData : GearData // without the Airburst flag. No authored value exists yet -- the flag is wired and unexercised until Cut // 6a or a later authoring pass sets it. [Inspectable, JsonProperty("airburstRange"), Key(29)] - public float AirburstRange; + public float? AirburstRange; } [CultDocument("aetheria.hulldata", "1"), Inspectable, MessagePackObject, JsonObject(MemberSerialization.OptIn)]