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

Fix crash in item_location serialization #62960

Merged
merged 2 commits into from
Jan 3, 2023

Conversation

mqrause
Copy link
Contributor

@mqrause mqrause commented Jan 1, 2023

Summary

None

Purpose of change

Fixes #62078
Fixes #62954

Describe the solution

Check container location before accessing it.
Move activity backlog deserialization to after character id deserialization because item locations on character depend on the id being loaded. Kind of a followup to #54323.

Describe alternatives you've considered

Testing

  1. Make character wearing backpack with filthy military rucksack inside the backpack, washing kit, enough soap (11) and water (88) to wash the rucksack
  2. Spawn a distraction nearby
  3. Start washing the rucksack and cancel it when the distraction query pops up
  4. Remove the distraction
  5. Start washing the rucksack again and finish it
  6. Wear the rucksack and take off the backpack
  7. Save the game

Saving would trigger the crash without this fix, now it doesn't.
The stale activity with stale item_locations will still be in the backlog and cause errors when loading, but they can be ignored.

Additional context

@github-actions github-actions bot added [C++] Changes (can be) made in C++. Previously named `Code` <Bugfix> This is a fix for a bug (or closes open issue) astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Jan 1, 2023
@mqrause mqrause marked this pull request as draft January 2, 2023 16:46
@mqrause mqrause marked this pull request as ready for review January 2, 2023 18:56
@mqrause mqrause force-pushed the loc_container_serialization_fix branch from fd081f2 to 4a33515 Compare January 2, 2023 19:13
@dseguin dseguin merged commit 318f16b into CleverRaven:master Jan 3, 2023
@mqrause mqrause deleted the loc_container_serialization_fix branch January 3, 2023 07:57
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.

Crash when (auto-)saving the game Mysterious crash to desktop
2 participants