浏览代码

Fix path with multiple slashes not being corrected on templates

(cherry picked from commit eef0327d1e1a19429157709fc15593a067b0f803)
Ricardo Subtil 4 年之前
父节点
当前提交
723ad5ef61
共有 1 个文件被更改,包括 1 次插入5 次删除
  1. 1 5
      core/project_settings.cpp

+ 1 - 5
core/project_settings.cpp

@@ -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();
 	}