瀏覽代碼

Fix res:// trimmed to s:// on Windows

Pedro J. Estébanez 5 年之前
父節點
當前提交
21703aefee
共有 1 個文件被更改,包括 9 次插入2 次删除
  1. 9 2
      drivers/windows/dir_access_windows.cpp

+ 9 - 2
drivers/windows/dir_access_windows.cpp

@@ -209,8 +209,15 @@ String DirAccessWindows::get_current_dir() {
 String DirAccessWindows::get_current_dir_without_drive() {
 
 	String dir = get_current_dir();
-	int p = current_dir.find(":");
-	return p != -1 ? dir.right(p + 1) : dir;
+
+	if (_get_root_string() == "") {
+		int p = current_dir.find(":");
+		if (p != -1) {
+			dir = dir.right(p + 1);
+		}
+	}
+
+	return dir;
 }
 
 bool DirAccessWindows::file_exists(String p_file) {