瀏覽代碼

推荐码处领取奖励红点修改

SCFC 7 月之前
父節點
當前提交
7b274a9e61
共有 1 個文件被更改,包括 16 次插入6 次删除
  1. 16 6
      script/module/present/RelationGiftLogic.lua

+ 16 - 6
script/module/present/RelationGiftLogic.lua

@@ -58,12 +58,22 @@ function onLogin(human)
               end
            
               if add then
-                 relationRew[i] = relationRew[i] or {} 
-                 relationRew[i].maxCnt = relationRew[i].maxCnt or 0
-                 relationRew[i].maxCnt = relationRew[i].maxCnt + 1
-                 if relationRew[i].maxCnt >= config.cnt then
-                    relationRew[i].maxCnt = config.cnt
-                 end
+                relationRew[i] = relationRew[i] or {} 
+                if relationRew[i].cnt then
+                    if relationRew[i].cnt < config.cnt then
+                        relationRew[i].maxCnt = relationRew[i].maxCnt or 0
+                        relationRew[i].maxCnt = relationRew[i].maxCnt + 1
+                        if relationRew[i].maxCnt >= config.cnt then
+                            relationRew[i].maxCnt = config.cnt
+                        end
+                    end
+                else
+                    relationRew[i].maxCnt = relationRew[i].maxCnt or 0
+                    relationRew[i].maxCnt = relationRew[i].maxCnt + 1
+                    if relationRew[i].maxCnt >= config.cnt then
+                        relationRew[i].maxCnt = config.cnt
+                    end
+                end
               end
            end
         end