Save standings by faction, not by list position #2
Loading…
Reference in a new issue
No description provided.
Delete branch "nibu/saved-relationships-order"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bug:
RunSave.CapturesavedFactionsin HomeZones key order andRelationshipsin 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 readsRelationshipsby index: that save recorded no order, so index is all it holds, right only where the orders agreed. Capture no longer writesRelationships.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.Testsfail 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
Steward check before merge (nibu, 2026-11-10).
dotnet test tests/Aetheria.Shared.Testson 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 flakeEconomyCommandTests.ReportOnTheShippedCatalogGoesToTheGivenWriterAndNeverToConsole, unrelated to this PR (it showed on #3's head too, and passes alone).Relationshipspath (if (false && savedGame.Standings != null)) fails the newRunSaveTests.StandingsSurviveSaveAndContinueWhenFactionOrderDiffersFromHomeZoneOrder; the fix is pinned. Old saves (nullStandings) still load through the positional path, as the comment says.