-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
[Core] Fix ResourceLoader.load
cache with relative paths
#90038
Conversation
Paths were not simplified meaning that `res://foo.bar` was treated differently from `./foo.bar` and similar
I see how this can fix the issue but I'm wondering if it won't have problems in more niche cases. In particular I'm wondering wether should not append the "res://" in case it is relative before anything else and handle it exactly the same so that there is exaclty no difference between "res://SomeScript.gd" and "./SomeScript". Maybe there is an actual downside of doing it like that that I didn't see. For clarification this is what I mens by apennding "res://" first : https://github.com/godotengine/godot/compare/master...ajreckof:Fix-ResourceLoader.load-cache-with-relative-paths?expand=1 |
This is the least disruptive solution, all it affects is the caching, your suggestion wouldn't change anything, see how the method works: godot/core/config/project_settings.cpp Lines 151 to 156 in 29b3d9e
The UID won't fetch anything as it won't be a UID |
Thanks! |
Thank you! |
Cherry-picked for 4.2.2. |
Paths were not simplified meaning that
res://foo.bar
was treated differently from./foo.bar
and similarThis matches how paths with the
res://
prefix are handled, which are simplified as part of thelocalize_path
The documentation for
load
states that these paths are not loaded, that's something to discuss and evaluate in a separate PR though, as this is is specific toResourceLoader.load
and just happens to affect this part as well, and loading relative paths in the resource loader is supported (no claim in the documentation to the contrary)There are also some potential issues with how threaded loading handles paths that I will look into separately, as it might be more consequential, as opposed to this which is a straightforward fix