Browse Source

修改计算服装战力

zhangyuqian 1 year ago
parent
commit
d894835b37
1 changed files with 6 additions and 2 deletions
  1. 6 2
      GameClient/Assets/Game/HotUpdate/Data/ItemDataManager.cs

+ 6 - 2
GameClient/Assets/Game/HotUpdate/Data/ItemDataManager.cs

@@ -283,14 +283,18 @@ namespace GFGGame
         /// <returns></returns>
         public static int GetItemAdditionScore(int itemId, int scoreType, string[] tags = null)
         {
-            if (_dataDic.TryGetValue(itemId, out var itemData))
+            //这里计算应该用总的物品表,因为自己没有所有物品
+            ItemCfg itemdate = ItemCfgArray.Instance.GetCfg(itemId);
+            ItemData itemDate = new ItemData() { };
+            if (itemdate != null)
             {
+                itemDate.id = itemdate.id;
                 int scroe = 0;
                 if (tags != null)
                 {
                     scroe += GetItemTagScore(itemId, tags);
                 }
-                scroe += itemData.GetScore(scoreType);
+                scroe += itemDate.GetScore(scoreType);
                 return scroe;
             }
             return 0;