Bladeren bron

修改梼杌一键领奖bug

gitxsm 10 maanden geleden
bovenliggende
commit
b77f4be2f1
1 gewijzigde bestanden met toevoegingen van 10 en 2 verwijderingen
  1. 10 2
      script/module/mozhu/MoZhuLogic.lua

+ 10 - 2
script/module/mozhu/MoZhuLogic.lua

@@ -476,19 +476,27 @@ function unionGetWL(human, msg)
 
 
     local len = 0
     local len = 0
     local itemVec = {}
     local itemVec = {}
+    local getIdx = human.db.mozhu.unionGet or 0
 
 
     for _, idx in ipairs(msg.rewardIdxList) do
     for _, idx in ipairs(msg.rewardIdxList) do
         local config = MoZhuExcel.hurt[idx]
         local config = MoZhuExcel.hurt[idx]
-        if config then
+        if config and idx > getIdx then
             for _, item in ipairs(config.reward) do
             for _, item in ipairs(config.reward) do
                 len = len + 1
                 len = len + 1
                 itemVec[len] = item
                 itemVec[len] = item
 
 
-                human.db.mozhu.unionGet = idx
+                getIdx = idx
+                -- human.db.mozhu.unionGet = idx
             end
             end
         end
         end
     end
     end
 
 
+    if len == 0 then
+        return
+    end
+
+    human.db.mozhu.unionGet = getIdx
+
     BagLogic.addItemList(human, itemVec,  "ciYuanMozhu")
     BagLogic.addItemList(human, itemVec,  "ciYuanMozhu")
 
 
     local msgRet = Msg.gc.GC_MOZHU_REWARD_GET
     local msgRet = Msg.gc.GC_MOZHU_REWARD_GET