浏览代码

Merge pull request #90038 from AThousandShips/load_path

[Core] Fix `ResourceLoader.load` cache with relative paths
Rémi Verschelde 1 年之前
父节点
当前提交
c8088c100f
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      core/io/resource_loader.cpp

+ 1 - 1
core/io/resource_loader.cpp

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