🐞 fix(节日活动): 划船免费次数计数
This commit is contained in:
@@ -80,9 +80,18 @@ export class DragonBoatData extends ActivityBase {
|
||||
this.buyCnt = playerData.buyCnt||0;
|
||||
this.todayPlayCnt = 0;
|
||||
this.playCnt = 0;
|
||||
let recByDay = new Map<number, number>();
|
||||
for(let { id, todayIndex, rewards } of (playerData.record||[])) {
|
||||
if(todayIndex == this.todayIndex) this.todayPlayCnt ++;
|
||||
this.playCnt ++;
|
||||
if(todayIndex == this.todayIndex) {
|
||||
this.todayPlayCnt ++;
|
||||
this.playCnt ++;
|
||||
} else {
|
||||
let n = recByDay.get(todayIndex)||0;
|
||||
if(n >= this.freeCnt) { // 不包含之前免费玩的次数
|
||||
this.playCnt ++;
|
||||
}
|
||||
recByDay.set(todayIndex, n + 1);
|
||||
}
|
||||
let route = this.routes.find(cur => cur.id == id);
|
||||
if(route) route.setPass(rewards);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user