Save standings by faction, not by list position #2

Merged
nibu merged 1 commit from nibu/saved-relationships-order into master 2026-11-10 17:45:16 +00:00
Member

Bug: RunSave.Capture saved Factions in HomeZones key order and Relationships in galaxy.Factions order; Galaxy's save constructor paired them by index. When the orders differ, Continue puts standings on the wrong factions.

Fix: new SavedGame.Standings (Key 16, faction ref + relationship) written by Capture and read by faction. A save without it still reads Relationships by index: that save recorded no order, so index is all it holds, right only where the orders agreed. Capture no longer writes Relationships.

Test: RunSaveTests.StandingsSurviveSaveAndContinueWhenFactionOrderDiffersFromHomeZoneOrder (3 factions, HomeZones order reversed, save/Continue round trip, each faction's standing asserted). Red before the fix (Corvid=Hated, Adrasteia=Beloved), green after.

Not run: 550 of 2905 Aetheria.Shared.Tests fail identically on master in my environment (mod catalog build: "First-party packages were excluded from the catalog"); the failing set with and without this change differs only by the new test. Unity and the full mod catalog were not exercised. Existing saves written with differing orders cannot be repaired: their true order was never recorded. No dedicated test pins the legacy (no Standings) read path beyond the existing fixtures that load it.

🤖 Generated with Claude Code

Bug: `RunSave.Capture` saved `Factions` in HomeZones key order and `Relationships` in galaxy.Factions order; Galaxy's save constructor paired them by index. When the orders differ, Continue puts standings on the wrong factions. Fix: new `SavedGame.Standings` (Key 16, faction ref + relationship) written by Capture and read by faction. A save without it still reads `Relationships` by index: that save recorded no order, so index is all it holds, right only where the orders agreed. Capture no longer writes `Relationships`. Test: `RunSaveTests.StandingsSurviveSaveAndContinueWhenFactionOrderDiffersFromHomeZoneOrder` (3 factions, HomeZones order reversed, save/Continue round trip, each faction's standing asserted). Red before the fix (Corvid=Hated, Adrasteia=Beloved), green after. Not run: 550 of 2905 `Aetheria.Shared.Tests` fail identically on master in my environment (mod catalog build: "First-party packages were excluded from the catalog"); the failing set with and without this change differs only by the new test. Unity and the full mod catalog were not exercised. Existing saves written with differing orders cannot be repaired: their true order was never recorded. No dedicated test pins the legacy (no Standings) read path beyond the existing fixtures that load it. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
RunSave.Capture wrote Factions in HomeZones key order and Relationships in
galaxy.Factions order; Galaxy's save constructor paired them by index, so a
galaxy whose two orders differed resumed with standings on the wrong factions.
SavedGame.Standings (Key 16) now carries each standing with its faction ref.
A save without it still reads Relationships by index, the only record it holds.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Author
Member

Steward check before merge (nibu, 2026-11-10).

  • Applies to master (it touches no file #3 touched); mergeable.
  • dotnet test tests/Aetheria.Shared.Tests on the PR head: 2889 pass, 16 fail. Master: 2889 pass, 15 fail (same pre-existing red set). The one extra is the parallel console-capture flake EconomyCommandTests.ReportOnTheShippedCatalogGoesToTheGivenWriterAndNeverToConsole, unrelated to this PR (it showed on #3's head too, and passes alone).
  • Falsification: forcing Galaxy's loader back to the positional Relationships path (if (false && savedGame.Standings != null)) fails the new RunSaveTests.StandingsSurviveSaveAndContinueWhenFactionOrderDiffersFromHomeZoneOrder; the fix is pinned. Old saves (null Standings) still load through the positional path, as the comment says.
  • Merged.
Steward check before merge (nibu, 2026-11-10). - Applies to master (it touches no file #3 touched); mergeable. - `dotnet test tests/Aetheria.Shared.Tests` on the PR head: 2889 pass, 16 fail. Master: 2889 pass, 15 fail (same pre-existing red set). The one extra is the parallel console-capture flake `EconomyCommandTests.ReportOnTheShippedCatalogGoesToTheGivenWriterAndNeverToConsole`, unrelated to this PR (it showed on #3's head too, and passes alone). - Falsification: forcing Galaxy's loader back to the positional `Relationships` path (`if (false && savedGame.Standings != null)`) fails the new `RunSaveTests.StandingsSurviveSaveAndContinueWhenFactionOrderDiffersFromHomeZoneOrder`; the fix is pinned. Old saves (null `Standings`) still load through the positional path, as the comment says. - Merged.
nibu merged commit 25594f480f into master 2026-11-10 17:45:16 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
GameCult/Aetheria!2
No description provided.