hexiaojie 10 luni în urmă
părinte
comite
263c0c4de1
1 a modificat fișierele cu 19 adăugiri și 11 ștergeri
  1. 19 11
      GameClient/Assets/Editor/Excel/Scanner/ItemApproachScanner.cs

+ 19 - 11
GameClient/Assets/Editor/Excel/Scanner/ItemApproachScanner.cs

@@ -720,23 +720,31 @@ namespace GFGEditor
         }
         private static bool CheckIsHasItem(int itemId, int checkId)
         {
-            ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(checkId);
-            if (itemCfg == null)
-            {
-                Log.Error($"CheckIsHasItem itemCfg is null. itemId:{itemId} checkId:{checkId}");
-            }
-            if (itemCfg.itemType == ConstItemType.USEABLE)
+            try
             {
-                for (int i = 0; i < itemCfg.itemsArr.Length; i++)
+                ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(checkId);
+                if (itemCfg == null)
                 {
-                    if (itemCfg.itemsArr[i][0] == itemId) return true;
+                    Log.Error($"CheckIsHasItem itemCfg is null. itemId:{itemId} checkId:{checkId}");
                 }
+                if (itemCfg.itemType == ConstItemType.USEABLE)
+                {
+                    for (int i = 0; i < itemCfg.itemsArr.Length; i++)
+                    {
+                        if (itemCfg.itemsArr[i][0] == itemId) return true;
+                    }
+                }
+                else if (checkId == itemId)
+                {
+                    return true;
+                }
+                return false;
             }
-            else if (checkId == itemId)
+            catch (Exception e)
             {
-                return true;
+                Log.Error($"CheckIsHasItemxxx itemCfg is null. itemId:{itemId} checkId:{checkId}");
+                throw;
             }
-            return false;
         }
 
         /// <summary>