summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkobewi <kobewi4e@gmail.com>2023-06-16 13:40:10 +0200
committerkobewi <kobewi4e@gmail.com>2023-06-16 13:40:10 +0200
commit313c0c7f5d8f5099f1a16735bc9aad1be33034b3 (patch)
treec59c6f47c32c95e5991c7c18af5eb33b21e27331
parent598378513b256e69e9b824c36136774c41cc763c (diff)
downloadredot-engine-313c0c7f5d8f5099f1a16735bc9aad1be33034b3.tar.gz
Fix missing UID handling for binary formats
-rw-r--r--core/io/resource_format_binary.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp
index b4da314e96..2a7a675f2d 100644
--- a/core/io/resource_format_binary.cpp
+++ b/core/io/resource_format_binary.cpp
@@ -920,8 +920,11 @@ void ResourceLoaderBinary::get_dependencies(Ref<FileAccess> p_f, List<String> *p
for (int i = 0; i < external_resources.size(); i++) {
String dep;
+ String fallback_path;
+
if (external_resources[i].uid != ResourceUID::INVALID_ID) {
dep = ResourceUID::get_singleton()->id_to_text(external_resources[i].uid);
+ fallback_path = external_resources[i].path; // Used by Dependency Editor, in case uid path fails.
} else {
dep = external_resources[i].path;
}
@@ -929,6 +932,12 @@ void ResourceLoaderBinary::get_dependencies(Ref<FileAccess> p_f, List<String> *p
if (p_add_types && !external_resources[i].type.is_empty()) {
dep += "::" + external_resources[i].type;
}
+ if (!fallback_path.is_empty()) {
+ if (!p_add_types) {
+ dep += "::"; // Ensure that path comes third, even if there is no type.
+ }
+ dep += "::" + fallback_path;
+ }
p_dependencies->push_back(dep);
}