diff options
Diffstat (limited to 'core/config/project_settings.cpp')
-rw-r--r-- | core/config/project_settings.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/core/config/project_settings.cpp b/core/config/project_settings.cpp index 001a351e0b..beef773699 100644 --- a/core/config/project_settings.cpp +++ b/core/config/project_settings.cpp @@ -153,8 +153,23 @@ const PackedStringArray ProjectSettings::_trim_to_supported_features(const Packe #endif // TOOLS_ENABLED String ProjectSettings::localize_path(const String &p_path) const { - if (resource_path.is_empty() || p_path.begins_with("res://") || p_path.begins_with("user://") || - (p_path.is_absolute_path() && !p_path.begins_with(resource_path))) { + if (resource_path.is_empty() || (p_path.is_absolute_path() && !p_path.begins_with(resource_path))) { + return p_path.simplify_path(); + } + + // Check if we have a special path (like res://) or a protocol identifier. + int p = p_path.find("://"); + bool found = false; + if (p > 0) { + found = true; + for (int i = 0; i < p; i++) { + if (!is_ascii_alphanumeric_char(p_path[i])) { + found = false; + break; + } + } + } + if (found) { return p_path.simplify_path(); } |