浏览代码

Properly localize absolute path.

Calling localize_path will return a localized path in res:// if the
path starts with the resource file-system/folder, and will return
the unchanged absolute path otherwise.

Closes #6979 and #7161.
Fabio Alessandrelli 8 年之前
父节点
当前提交
cdc97ca453
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      core/globals.cpp

+ 2 - 1
core/globals.cpp

@@ -54,7 +54,8 @@ String Globals::localize_path(const String& p_path) const {
 	if (resource_path=="")
 		return p_path; //not initialied yet
 
-	if (p_path.begins_with("res://") || p_path.begins_with("user://") || p_path.is_abs_path())
+	if (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();