浏览代码

增加错误提示!

guodong 2 年之前
父节点
当前提交
2888ad90f6
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      GameClient/Assets/Game/HotUpdate/Views/ClothingSynthetic/ClothingSyntheticView.cs

+ 5 - 0
GameClient/Assets/Game/HotUpdate/Views/ClothingSynthetic/ClothingSyntheticView.cs

@@ -309,6 +309,11 @@ namespace GFGGame
             ItemCfg clothingSyntheticCfg = ItemCfgArray.Instance.GetCfg(_selectedItemId);
             // string costName = ItemUtil.GetItemName(clothingSyntheticCfg.syntheticCostID);
             // _ui.m_txtCost.SetVar("v1", "" + clothingSyntheticCfg.syntheticCostNum).SetVar("v2", costName).FlushVars();
+            if(clothingSyntheticCfg.syntheticCostID <= 0)
+            {
+                Log.Error($"请为物品 {clothingSyntheticCfg.id} 增加合成相关配置!");
+                return;
+            }
             ItemUtil.SetItemNeedNum(_ui.m_comCostCurrency, clothingSyntheticCfg.syntheticCostID, clothingSyntheticCfg.syntheticCostNum);
             _materiarsOfSelectedItem = ItemUtil.CreateItemDataList(clothingSyntheticCfg.syntheticMateriarsArr);
             _ui.m_listMaterias.numItems = _materiarsOfSelectedItem.Count;