Fix path with multiple slashes not being corrected on templates

(cherry picked from commit eef0327d1e)
This commit is contained in:
Ricardo Subtil 2021-09-09 15:48:37 +01:00 committed by Rémi Verschelde
parent fb17ac885a
commit 723ad5ef61
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -54,11 +54,7 @@ String ProjectSettings::get_resource_path() const {
};
String ProjectSettings::localize_path(const String &p_path) const {
if (resource_path == "") {
return p_path; //not initialized yet
}
if (p_path.begins_with("res://") || p_path.begins_with("user://") ||
if (resource_path.empty() || p_path.begins_with("res://") || p_path.begins_with("user://") ||
(p_path.is_abs_path() && !p_path.begins_with(resource_path))) {
return p_path.simplify_path();
}