diff options
author | PucklaMotzer09 <jonaas.pucher000000@gmail.com> | 2022-01-04 18:52:32 +0100 |
---|---|---|
committer | PucklaMotzer09 <jonaas.pucher000000@gmail.com> | 2022-08-03 12:31:29 +0200 |
commit | b32b570d7a64dfdce02605557532754a8629e68a (patch) | |
tree | 542859f8b4fe89417c16e635597a2dba187e45df /core/io | |
parent | 0f9086e131923e09e97a2ef2f0e9f39565be0c27 (diff) |
Show dependency warning when removing remaps and fallback if translation
remap does not exist
Diffstat (limited to 'core/io')
-rw-r--r-- | core/io/resource_loader.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp index fc4177004b..3e595557f9 100644 --- a/core/io/resource_loader.cpp +++ b/core/io/resource_loader.cpp @@ -819,6 +819,12 @@ String ResourceLoader::_path_remap(const String &p_path, bool *r_translation_rem if (r_translation_remapped) { *r_translation_remapped = true; } + + // Fallback to p_path if new_path does not exist. + if (!FileAccess::exists(new_path)) { + WARN_PRINT(vformat("Translation remap '%s' does not exist. Falling back to '%s'.", new_path, p_path)); + new_path = p_path; + } } if (path_remaps.has(new_path)) { |