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

Create PauseLockSession during PostLoadInit in ExposeData #493

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SokyranTheDragon
Copy link
Member

Normally, calling UniqueIDsManager.GetNextID gives a warning when that happens, which made me realize that it's potentially unsafe to do so - the IDs may have not been loaded at that point. This should not happen when saving the data, as the session should exist at that point.

The solution here is to only create the session when Scribe.mode is LoadSaveMode.PostLoadInit. This ensures the IDs are initialized and getting the next ID won't cause any issues.

Normally, calling `UniqueIDsManager.GetNextID` gives a warning when that happens, which made me realize that it's potentially unsafe to do so - the IDs may have not been loaded at that point. This should not happen when saving the data, as the session should exist at that point.

The solution here is to only create the session when `Scribe.mode` is `LoadSaveMode.PostLoadInit`. This ensures the IDs are initialized and getting the next ID won't cause any issues.
@SokyranTheDragon SokyranTheDragon added 1.5 Fixes or bugs relating to 1.5 (Not Anomaly). fix Fixes for a bug or desync. labels Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.5 Fixes or bugs relating to 1.5 (Not Anomaly). fix Fixes for a bug or desync.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant