Browse Source

Bugly 摘星右键的红点是否显示判断防止报错

huangxiaoyue 1 năm trước cách đây
mục cha
commit
9201291217

+ 4 - 4
GameClient/Assets/Game/HotUpdate/Data/LuckyBoxDataManager.cs

@@ -314,14 +314,14 @@ namespace GFGGame
 
         public bool RedBtnRight(int curIndex)
         {
-            int index = curIndex + 1;
-            for (int i = index; i < BOX_ID_3; i++) {
-                int boxId = LuckyBoxDataManager.Instance.luckyBoxIds[i];
+            var luckyBoxIds = LuckyBoxDataManager.Instance.luckyBoxIds;
+            for (int i = curIndex + 1; i < luckyBoxIds.Count; i++) {
+                int boxId = luckyBoxIds[i];
                 long freeTime = LuckyBoxDataManager.Instance.GetFreeTime(boxId);
                 if (freeTime > 0 && freeTime - TimeHelper.ServerNow() < 0)
                     return true;
 
-                if (index == 1 && RedDotDataManager.Instance.GetActLuckyBoxRewardRed(ConstLimitTimeActivityType.ActLimitTsy))
+                if (curIndex == 1 && RedDotDataManager.Instance.GetActLuckyBoxRewardRed(ConstLimitTimeActivityType.ActLimitTsy))
                     return true;
             }