[Core] Fix `ResourceLoader.load` cache with relative paths

Paths were not simplified meaning that `res://foo.bar` was treated
differently from `./foo.bar` and similar

(cherry picked from commit 0274877def)
This commit is contained in:
A Thousand Ships 2024-03-30 12:49:52 +01:00 committed by Rémi Verschelde
parent f890c5d299
commit 2114489e23
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 1 additions and 1 deletions

View File

@ -378,7 +378,7 @@ static String _validate_local_path(const String &p_path) {
if (uid != ResourceUID::INVALID_ID) {
return ResourceUID::get_singleton()->get_id_path(uid);
} else if (p_path.is_relative_path()) {
return "res://" + p_path;
return ("res://" + p_path).simplify_path();
} else {
return ProjectSettings::get_singleton()->localize_path(p_path);
}