summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorkobewi <kobewi4e@gmail.com>2022-10-09 13:52:04 +0200
committerkobewi <kobewi4e@gmail.com>2022-10-10 11:20:23 +0200
commit14b82c36a25755b18f6d18102167b50fd4ac01e8 (patch)
tree5e8f0d0970044305e06d57b732bd71b875417a84 /scene
parent104af08e9d7c8308c2dd6cad89a0caee774043a0 (diff)
Defer clearing of ResourceUID cache and silence warnings
Diffstat (limited to 'scene')
-rw-r--r--scene/resources/resource_format_text.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/scene/resources/resource_format_text.cpp b/scene/resources/resource_format_text.cpp
index c0d65fb445..85b538b1d9 100644
--- a/scene/resources/resource_format_text.cpp
+++ b/scene/resources/resource_format_text.cpp
@@ -445,7 +445,14 @@ Error ResourceLoaderText::load() {
// If a UID is found and the path is valid, it will be used, otherwise, it falls back to the path.
path = ResourceUID::get_singleton()->get_id_path(uid);
} else {
+#ifdef TOOLS_ENABLED
+ // Silence a warning that can happen during the initial filesystem scan due to cache being regenerated.
+ if (ResourceLoader::get_resource_uid(path) != uid) {
+ WARN_PRINT(String(res_path + ":" + itos(lines) + " - ext_resource, invalid UUID: " + uidt + " - using text path instead: " + path).utf8().get_data());
+ }
+#else
WARN_PRINT(String(res_path + ":" + itos(lines) + " - ext_resource, invalid UUID: " + uidt + " - using text path instead: " + path).utf8().get_data());
+#endif
}
}