-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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 shared exported variables of inherited scenes #88741
Fix shared exported variables of inherited scenes #88741
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested my MRP with this change and I wasn't able to figure out how to alias the Dictionary
again using a similar strategy, so it seems to work.
9997543
to
d53a1b0
Compare
While this works, I wonder why is it even necessary. Why the issue happens in the first place, and only for inherited scenes? |
From what I remember, it's because inherited scenes will use the same Variant of the parent if we're not careful. |
CC @godotengine/gdscript |
But when creating more instances should ensure duplication of variables. Like, when you have 2 instances with exported Dictionary then it's unique, but when these instances use inherited scene, the same variable is suddenly shared. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fix works and looks safe.
Thanks! |
This PR fixes the "shared" exported variables of inherited scenes.
Supersedes
Supersedes #88739.
MRP
Many thanks to @exodrifter for her MRP.
dictionary-aliasing.zip
Notes to merging team
I added the label
cherrypick:4.2
, but this may break projects if they are "exploiting" the bug, ie. fake static variables.Fixes
Fixes #81526.