Browse Source

fix get file path in material database for root directories

lviguier 1 năm trước cách đây
mục cha
commit
c4045060e0
1 tập tin đã thay đổi với 3 bổ sung1 xóa
  1. 3 1
      h3d/mat/MaterialDatabase.hx

+ 3 - 1
h3d/mat/MaterialDatabase.hx

@@ -8,7 +8,9 @@ class MaterialDatabase {
 	}
 
 	function getFilePath( model : hxd.res.Resource ) {
-		return model.entry.directory+"/materials.props";
+		var dir = model.entry.directory;
+		var filename = "materials.props";
+		return dir == null || dir == "" ? filename : model.entry.directory + "/" + filename;
 	}
 
 	public function getModelData( model : hxd.res.Resource ) {