Skip to content

Conversation

@Wartori54
Copy link
Member

Fixes #989. Introduces a new field in LevelSetStats which stores the AreaStats that have no matching loaded AreaData. This makes it so the extra AreaStats are not deleted but instead moved elsewhere, then each time save data is loaded those AreaStats are taken into account again and potentially moved back to the main Areas list.

Since this PR touches SaveData code, I'd appreciate if it could get three approvals instead before merging.

@maddie480-bot maddie480-bot added the review needed This PR needs 2 approvals to be merged (bot-managed) label Sep 28, 2025
Copy link
Contributor

@DashingCat DashingCat left a comment

Choose a reason for hiding this comment

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

I was able to reproduce the linked issue (#989) and in my testing this PR fixes the issue.

I would maybe add a few things to make the code a bit clearer :

  • some logging when adding an area to areasBin;
  • some kind of constants for int.MaxValue and int.MaxValue - 1, maybe like missingAreaID and subAreaID;
  • a comment explaining how an area can end up in the areasBin.

@Wartori54
Copy link
Member Author

@DashingCat thank you for your review, I have applied the feedback from your comment in the latest commit. I have also added xmldocs and logging for the very similar LevelSetRecycleBin, since otherwise it felt incorrect to add logging for areas but not levelsets.

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

Labels

review needed This PR needs 2 approvals to be merged (bot-managed)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Map folder conflicts cause save data loss

3 participants