shawenguan 1 year ago
parent
commit
9654e1ea03
1 changed files with 10 additions and 4 deletions
  1. 10 4
      Scripts/hbcpre/hbcpreHelper.js

+ 10 - 4
Scripts/hbcpre/hbcpreHelper.js

@@ -473,19 +473,25 @@ function handleCompoundIndex(){
     // all_num 总量
     // sy_num 剩余
     collection.random_name = `${collection.random_name}(${collection.sy_num}/${collection.all_num})`;
-    // 材料产品
+    // 固定材料
     let needList = collection.need;
     for(let i=0; i < needList.length; i++){
         let iData = needList[i];
         if(iData.count_num == 0){
             iData.count_num = iData.need_num;
         }
-        // if(iData.user_count == 0){
-        //     iData.user_count = iData.need_num;
-        // }
+        if(iData.user_count == 0){
+            iData.user_count = iData.need_num;
+        }
     }
 
+    // 随机材料-需要选择
     let randomList = data.randomcollection;
+    if(randomList.length == 0){
+        data.randomcollection = [
+            [{id: 0, count_num: 10000, nums: 0}],
+        ];
+    }
 
     // 合成产品
     let collectionList = data.collection_list;