From 0693c896c659f84c8b7ad47a2b83620cfb0ccda0 Mon Sep 17 00:00:00 2001 From: luying Date: Wed, 30 Dec 2020 11:05:40 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E8=97=8F=E5=AE=9D=E5=9B=BE=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E4=B8=8D=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game-server/app/services/warRewardService.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/game-server/app/services/warRewardService.ts b/game-server/app/services/warRewardService.ts index 890da7311..d55ac6acc 100644 --- a/game-server/app/services/warRewardService.ts +++ b/game-server/app/services/warRewardService.ts @@ -19,7 +19,7 @@ export class WarReward { private condition: Map; private warInfo: any; private isSuccess: boolean; - private rewards: Array<{type: number, gid: number, count: number, times: number}>; + private rewards: Array<{type: number, id: number, count: number, times: number}>; private fixReward: string; private conditionReward: string; private randomReward: string; @@ -106,8 +106,8 @@ export class WarReward { let reward = decodeStr('randomReward', randomReward); for(let obj of reward) { - let { gid, frequency } = obj; - let dropHistory = await BattleDropModel.findByGid(this.roleId, this.battleId, gid); + let { id, frequency } = obj; + let dropHistory = await BattleDropModel.findByGid(this.roleId, this.battleId, id); let { getNum = 0, allNum = 0, getSum = 0, allSum = 0 } = dropHistory; for(let i = 0; i < num; i ++) { let flag = false; // 是否可以获得 @@ -126,7 +126,7 @@ export class WarReward { this.rewards.push({type: BATTLE_REWARD_TYPE.RANDOM_REWARD, times: i +1, ...obj}); } } - await BattleDropModel.updateByGid(this.roleId, this.battleId, gid, { + await BattleDropModel.updateByGid(this.roleId, this.battleId, id, { getNum, allNum, getSum, allSum }); } @@ -179,7 +179,7 @@ export class WarReward { const blueprtList = getBluePrtByQuality(id); const gid = getRandomByLen(blueprtList); - return {gid, count:1} + return {id: gid, count:1} } else { return null }