|
|
@@ -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
|