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

[3.x] Fix sub-resource storing the wrong index in cache #49625

Merged
merged 1 commit into from
Jun 15, 2021

Conversation

pouleyKetchoupp
Copy link
Contributor

Fixes #49622 on 3.x branch.

  1. Backport sub-resource cache fixes from master.

Partial backport of #45903 (just the sub-resource cache fix, not additional cache modes).
Uses a cache by index to keep sub resource indices consistent.

  1. Backport of Fix sub-resource storing the wrong index in cache #49624

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.

1. Backport sub-resource cache fixes from master.
Uses a cache by index to keep sub resource indices consistent.

2. 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 <[email protected]>
@pouleyKetchoupp pouleyKetchoupp added this to the 3.4 milestone Jun 15, 2021
@pouleyKetchoupp pouleyKetchoupp requested a review from a team June 15, 2021 17:08
@akien-mga akien-mga merged commit de04394 into godotengine:3.x Jun 15, 2021
@akien-mga
Copy link
Member

Thanks!

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.

2 participants