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 sub-resource storing the wrong index in cache #49624

Merged
merged 1 commit into from
Jun 15, 2021

Conversation

pouleyKetchoupp
Copy link
Contributor

Fixes #49622

The subindex within Resource wasn't synchronized with the path stored in cache when saving a packed scene. It could cause sub-resources to be swapped when loading the same packed scene in the same session.

Now the subindex in Resource reflects the sub-resource path in cache, making saving and loading sub-resources consistent.

Credits to @latorril for finding the issue and investigating the cause.

The subindex within Resource wasn't synchronized with the path stored
in cache when saving a packed scene. It could cause sub-resources to be
swapped when loading the same packed scene in the same session.

Now the subindex in Resource reflects the sub-resource path in cache,
making saving and loading sub-resources consistent.

Co-authored-by: latorril <latorril@gmail.com>
@pouleyKetchoupp pouleyKetchoupp added this to the 4.0 milestone Jun 15, 2021
@pouleyKetchoupp pouleyKetchoupp requested a review from a team June 15, 2021 17:01
@akien-mga akien-mga added cherrypick:3.3 cherrypick:3.x Considered for cherry-picking into a future 3.x release and removed cherrypick:3.3 cherrypick:3.x Considered for cherry-picking into a future 3.x release labels Jun 15, 2021
@akien-mga akien-mga merged commit 1cc6385 into godotengine:master Jun 15, 2021
@akien-mga
Copy link
Member

Thanks!

@pouleyKetchoupp pouleyKetchoupp deleted the fix-sub-resource-cache branch June 16, 2021 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sub resource indices are shuffled when saving packed scenes in game, causing random missing resources on load
2 participants