소스 검색

look for /res in local dir if not found in exe dir

Nicolas Cannasse 10 년 전
부모
커밋
6c079af0b9
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      hxd/fs/LocalFileSystem.hx

+ 5 - 1
hxd/fs/LocalFileSystem.hx

@@ -335,7 +335,11 @@ class LocalFileSystem implements FileSystem {
 		var exePath = Sys.executablePath().split("\\").join("/").split("/");
 		exePath.pop();
 		var froot = sys.FileSystem.fullPath(exePath.join("/") + "/" + baseDir);
-		if( !sys.FileSystem.isDirectory(froot) ) throw "Could not find dir " + dir;
+		if( !sys.FileSystem.isDirectory(froot) ) {
+			froot = sys.FileSystem.fullPath(baseDir);
+			if( !sys.FileSystem.isDirectory(froot) )
+				throw "Could not find dir " + dir;
+		}
 		baseDir = froot.split("\\").join("/");
 		if( !StringTools.endsWith(baseDir, "/") ) baseDir += "/";
 		root = new LocalEntry(this, "root", null, baseDir);