浏览代码

ModelDatabase : fix save data on models wihout lodConfig

lviguier 1 年之前
父节点
当前提交
b4321d8988
共有 1 个文件被更改,包括 8 次插入6 次删除
  1. 8 6
      h3d/prim/ModelDatabase.hx

+ 8 - 6
h3d/prim/ModelDatabase.hx

@@ -68,13 +68,15 @@ class ModelDatabase {
 		var isDefaultConfig = true;
 		var defaultConfig = getDefaultLodConfig(@:privateAccess hmd.lib.resource.entry.directory);
 
-		if (defaultConfig.length != @:privateAccess hmd.lodConfig.length)
-			isDefaultConfig = false;
-
-		for (idx in 0...@:privateAccess hmd.lodConfig.length) {
-			if (defaultConfig[idx] != @:privateAccess hmd.lodConfig[idx]) {
+		if (@:privateAccess hmd.lodConfig != null) {
+			if (defaultConfig.length != @:privateAccess hmd.lodConfig.length)
 				isDefaultConfig = false;
-				break;
+
+			for (idx in 0...@:privateAccess hmd.lodConfig.length) {
+				if (defaultConfig[idx] != @:privateAccess hmd.lodConfig[idx]) {
+					isDefaultConfig = false;
+					break;
+				}
 			}
 		}