Skip to content

Fix starting items settings string roundtrip - #36

Open
flee135 wants to merge 1 commit into
fenhl:dev-fenhlfrom
flee135:starting-items
Open

Fix starting items settings string roundtrip#36
flee135 wants to merge 1 commit into
fenhl:dev-fenhlfrom
flee135:starting-items

Conversation

@flee135

@flee135 flee135 commented Jul 30, 2026

Copy link
Copy Markdown

Fixes #35.

Starting items are stored either in a starting_items dict or as the lists 'starting_equipment', 'starting_inventory', 'starting_songs'. The encoder and decoder both work under the assumption that the data was in starting_items. But after commit 1be9b08 ("Allow plandoing different settings per world"), the conversion from lists to dict runs in each world's copy of the settings, and the shared Settings object is never normalized.

get_legacy_starting_items() was added to produce the list format using starting_items if populated, and the three lists otherwise. This is used both when encoding and decoding.

Discovery of the bug and the proposed solution are via Claude, and reviewed and slightly tweaked by myself.

Testing

Verified by importing settings strings containing starting items prior to and after the change and checked that the items were still present.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Starting items do not survive settings string roundtrip

1 participant