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