zhaoyang 2 жил өмнө
parent
commit
668a2d78e5

+ 3 - 3
GameClient/Assets/Game/HotUpdate/Views/Arena/ArenaView.cs

@@ -194,11 +194,11 @@ namespace GFGGame
             if (RoleDataManager.ArenaFreshTimes <= 0)
             {
                 int costId = GlobalCfgArray.globalCfg.costIdBuyFreshTimes;
-                long hasNum = GlobalCfgArray.globalCfg.costNumBuyFreshTimes;
-                if (!ItemUtil.CheckItemEnough(costId, hasNum))
+                long needNum = GlobalCfgArray.globalCfg.costNumBuyFreshTimes;
+                if (!ItemUtil.CheckItemEnough(costId, needNum))
                 {
                     long has = ItemDataManager.GetItemNum(costId);
-                    ItemUtil.BuyCurrency(costId, hasNum - has);
+                    ItemUtil.BuyCurrency(costId, needNum - has);
                     return;
                 }
             }

+ 3 - 3
GameClient/Assets/Game/HotUpdate/Views/CommonGame/BuyConfirmView.cs

@@ -57,11 +57,11 @@ namespace GFGGame
         {
 
             int costId = GlobalCfgArray.globalCfg.costIdBuyFightTimes;
-            long hasNum = GlobalCfgArray.globalCfg.costNumBuyFightTimes;
-            if (!ItemUtil.CheckItemEnough(costId, hasNum))
+            long needNum = GlobalCfgArray.globalCfg.costNumBuyFightTimes;
+            if (!ItemUtil.CheckItemEnough(costId, needNum))
             {
                 long has = ItemDataManager.GetItemNum(costId);
-                ItemUtil.BuyCurrency(costId, hasNum - has);
+                ItemUtil.BuyCurrency(costId, needNum - has);
                 return;
             }
 

+ 10 - 3
GameClient/Assets/Game/HotUpdate/Views/League/LeaguePrayView.cs

@@ -98,9 +98,9 @@ namespace GFGGame
             int type = (int)(context.sender as GObject).data;
             LeaguePrayCfg prayCfg = LeaguePrayCfgArray.Instance.GetCfg(type);
             int curTimes = LeagueDataManager.Instance.GetPrayTimesByType(type);
-            long hasCount = ItemDataManager.GetItemNum(prayCfg.consumeArr[0][0]);
-            long needCount = prayCfg.consumeArr[0][1];
-            if (type == LeaguePrayType.First && curTimes != 0 && hasCount < needCount || type != LeaguePrayType.First && hasCount < needCount)
+            // long hasCount = ItemDataManager.GetItemNum(prayCfg.consumeArr[0][0]);
+            // long needCount = prayCfg.consumeArr[0][1];
+            if (type == LeaguePrayType.First && curTimes != 0 || type != LeaguePrayType.First)
             {
                 if (prayCfg.consumeArr[0][0] == ConstItemID.GOLD)
                 {
@@ -114,6 +114,13 @@ namespace GFGGame
                 {
                     PromptController.Instance.ShowFloatTextPrompt("消耗不足");
                 }
+
+                if (!ItemUtil.CheckItemEnough(prayCfg.consumeArr[0][0], prayCfg.consumeArr[0][1]))
+                {
+                    long has = ItemDataManager.GetItemNum(prayCfg.consumeArr[0][0]);
+                    ItemUtil.BuyCurrency(prayCfg.consumeArr[0][0], prayCfg.consumeArr[0][1] - has);
+                    return;
+                }
                 return;
             }
             LeagueSproxy.ReqPrayLeague(type).Coroutine();