From cdc97ca4535e99fdcb10f21c4609c2f79e94589b Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Sun, 30 Oct 2016 18:22:05 +0100 Subject: [PATCH] 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. --- core/globals.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/globals.cpp b/core/globals.cpp index bef40ff330..78b97882be 100644 --- a/core/globals.cpp +++ b/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();