Просмотр исходного кода

Bugly词牌升星取消选择消耗品防止报错

huangxiaoyue 1 год назад
Родитель
Сommit
be57fccc68
1 измененных файлов с 1 добавлено и 3 удалено
  1. 1 3
      GameClient/Assets/Game/HotUpdate/Views/Card/CardFosterView.cs

+ 1 - 3
GameClient/Assets/Game/HotUpdate/Views/Card/CardFosterView.cs

@@ -565,11 +565,9 @@ namespace GFGGame
         {
             UI_ComConsume listItem = UI_ComConsume.Proxy(obj);
             int index = (int)listItem.target.data;
-
-            if (itemsCount[index] == 0)
+            if (index >= itemsCount.Count|| itemsCount[index] == 0)
             {
                 Timers.inst.Remove(OnTimedEvent);
-
                 return;
             }
             itemsCount[index] = itemsCount[index] - 1;