Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

savegame: migrate addiction variants #56915

Merged
merged 1 commit into from
Apr 19, 2022

Conversation

andrei8l
Copy link
Contributor

@andrei8l andrei8l commented Apr 19, 2022

Summary

None

Purpose of change

Saved games with addiction events serialized before #56786 can't be loaded

Fixes: #56916

Describe the solution

Convert the addiction cata_variant on save load

Describe alternatives you've considered

N/A: events are lazily evaluated so the conversion needs to happen during I/O

Testing

  1. Load this save Harrisonville.tar.gz
  2. Observe the serialized event in #YW5kcmVp.sav :[ { "add_type": [ "add_type", "PKILLER" ], "character": [ "character_id", "1" ] }, { "count": 1, "first": 16415854, "last": 16415854 } ]
  3. Quicksave and verify conversion to [ { "add_type": [ "addiction_id", "opiate" ], ... ]
  4. Eat 100 poppy painkillers then quicksave
  5. Confirm event count increased to 2

Additional context

Maybe there's a better way; let's see what dseguin or jbytheway have to say

@github-actions github-actions bot added [C++] Changes (can be) made in C++. Previously named `Code` json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions labels Apr 19, 2022
@BrettDong BrettDong added the <Bugfix> This is a fix for a bug (or closes open issue) label Apr 19, 2022
Copy link
Member

@dseguin dseguin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this! Looks good to go.

@dseguin dseguin merged commit ee59875 into CleverRaven:master Apr 19, 2022
@andrei8l andrei8l deleted the add_type-migration branch April 19, 2022 14:52
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Apr 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fail to load any save
3 participants