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 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-09-19 18:56:53 +02:00
commit c896489b39
2 changed files with 2 additions and 2 deletions

View file

@ -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
{