소스 검색

Fix crash when using LOD without any instance of LocalFileSystem

TothBenoit 1 년 전
부모
커밋
2f9fe24efe
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      h3d/prim/ModelDatabase.hx

+ 2 - 0
h3d/prim/ModelDatabase.hx

@@ -93,6 +93,8 @@ class ModelDatabase {
 
 	public function getDefaultLodConfig( dir : String ) : Array<Float> {
 		var fs = Std.downcast(hxd.res.Loader.currentInstance.fs, hxd.fs.LocalFileSystem);
+		if (fs == null)
+			return baseLodConfig;
 		var c = @:privateAccess fs.convert.getConfig(defaultLodConfigs, baseLodConfig, dir, function(fullObj) {
 			if (Reflect.hasField(fullObj, "lods.screenRatio"))
 				return Reflect.field(fullObj, "lods.screenRatio");