From 44d9e8064063936bfea7b82ec69a9ccc1a6a8e51 Mon Sep 17 00:00:00 2001 From: luying Date: Tue, 1 Jun 2021 10:34:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=EF=BC=9A=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=88=9B=E5=BB=BA=E8=A7=92=E8=89=B2bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game-server/app/services/rewardService.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/game-server/app/services/rewardService.ts b/game-server/app/services/rewardService.ts index 1c535e16e..2147d7410 100644 --- a/game-server/app/services/rewardService.ts +++ b/game-server/app/services/rewardService.ts @@ -304,22 +304,22 @@ export async function pushFigureUpdate(roleId: string, sid: string, figureInfo: * @param heroInfo */ export async function createHeroes(roleId: string, roleName: string, sid: string, serverId: number, funcs: number[], heroInfo: CreateHeroParam[]) { - let hids = heroInfo.map(cur => cur.hid); let userHeroesMap = await HeroModel.findMapByHidRange(hids, roleId); let newHeroInfo: CreateHeroParam[] = [], pieces: ItemInter[] = []; for (let h of heroInfo) { + let heroCount = h.count||1; if (userHeroesMap.has(h.hid)) { let { pieceId, count } = transPiece(h.hid); - pieces.push({ id: pieceId, count: count * h.count }); + pieces.push({ id: pieceId, count: count * heroCount }); } else { newHeroInfo.push(h) userHeroesMap.set(h.hid, null); - if (h.count > 1) { + if (heroCount > 1) { let { pieceId, count } = transPiece(h.hid); - pieces.push({ id: pieceId, count: count * (h.count - 1) }); + pieces.push({ id: pieceId, count: count * (heroCount - 1) }); } } }