summaryrefslogtreecommitdiffstats
path: root/core/io/resource_loader.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-06-11 11:46:35 +0200
committerRémi Verschelde <rverschelde@gmail.com>2024-06-11 11:46:35 +0200
commite4fa8543ea11b7d25c24c81c4a0b824b60fb82ec (patch)
tree1cb028256f8c3dbb92ea9ea4c7af73d1c363d451 /core/io/resource_loader.cpp
parent62a056aa56ca4471c035e43741c88e4a22d81802 (diff)
downloadredot-engine-e4fa8543ea11b7d25c24c81c4a0b824b60fb82ec.tar.gz
Revert "Fix FileSystem dock won't show any file folders"
This reverts commit 72856d633a6be5c596d4a3231acab009828a2efe. Fixes #93022.
Diffstat (limited to 'core/io/resource_loader.cpp')
-rw-r--r--core/io/resource_loader.cpp61
1 files changed, 29 insertions, 32 deletions
diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp
index 7299631fec..c3c37aa89d 100644
--- a/core/io/resource_loader.cpp
+++ b/core/io/resource_loader.cpp
@@ -957,39 +957,36 @@ String ResourceLoader::_path_remap(const String &p_path, bool *r_translation_rem
new_path = path_remaps[new_path];
} else {
// Try file remap.
- // Usually, there's no remap file and FileAccess::exists() is faster then FileAccess::open().
- if (FileAccess::exists(new_path + ".remap")) {
- Error err;
- Ref<FileAccess> f = FileAccess::open(new_path + ".remap", FileAccess::READ, &err);
- if (f.is_valid()) {
- VariantParser::StreamFile stream;
- stream.f = f;
-
- String assign;
- Variant value;
- VariantParser::Tag next_tag;
-
- int lines = 0;
- String error_text;
- while (true) {
- assign = Variant();
- next_tag.fields.clear();
- next_tag.name = String();
-
- err = VariantParser::parse_tag_assign_eof(&stream, lines, error_text, next_tag, assign, value, nullptr, true);
- if (err == ERR_FILE_EOF) {
- break;
- } else if (err != OK) {
- ERR_PRINT("Parse error: " + p_path + ".remap:" + itos(lines) + " error: " + error_text + ".");
- break;
- }
+ Error err;
+ Ref<FileAccess> f = FileAccess::open(new_path + ".remap", FileAccess::READ, &err);
+ if (f.is_valid()) {
+ VariantParser::StreamFile stream;
+ stream.f = f;
+
+ String assign;
+ Variant value;
+ VariantParser::Tag next_tag;
+
+ int lines = 0;
+ String error_text;
+ while (true) {
+ assign = Variant();
+ next_tag.fields.clear();
+ next_tag.name = String();
+
+ err = VariantParser::parse_tag_assign_eof(&stream, lines, error_text, next_tag, assign, value, nullptr, true);
+ if (err == ERR_FILE_EOF) {
+ break;
+ } else if (err != OK) {
+ ERR_PRINT("Parse error: " + p_path + ".remap:" + itos(lines) + " error: " + error_text + ".");
+ break;
+ }
- if (assign == "path") {
- new_path = value;
- break;
- } else if (next_tag.name != "remap") {
- break;
- }
+ if (assign == "path") {
+ new_path = value;
+ break;
+ } else if (next_tag.name != "remap") {
+ break;
}
}
}