From b07e4048d0cfdcff8d16850bb6a0627c0c217e64 Mon Sep 17 00:00:00 2001 From: luying Date: Tue, 19 Oct 2021 16:12:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=AD=A6=E5=B0=86=EF=BC=9A=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=85=A8=E9=83=A8=E6=AD=A6=E5=B0=86=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/servers/role/handler/heroHandler.ts | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/game-server/app/servers/role/handler/heroHandler.ts b/game-server/app/servers/role/handler/heroHandler.ts index 3871a5367..832bebd12 100644 --- a/game-server/app/servers/role/handler/heroHandler.ts +++ b/game-server/app/servers/role/handler/heroHandler.ts @@ -625,20 +625,17 @@ export class HeroHandler { return resResult(STATUS.TOKEN_ERR); } - let dicHero = gameData.hero; - if (!dicHero) return resResult(STATUS.HERO_NOT_FIND); - let heroes = await HeroModel.findByRole(roleId); let heroInfos = []; - for (let [hid, dic] of dicHero) { - if(hid < 300 && dic.initialSkin > 0) { - let hasHero = heroes.findIndex(cur => cur.hid == hid); - if(hasHero == -1) { - heroInfos.push({ - hid, star: 6, colorStar: 6, quality: 4 - }); - } + for(let { actorId } of gameData.recruit) { + let dicHero = gameData.hero.get(actorId); + if(!dicHero) continue; + let hasHero = heroes.findIndex(cur => cur.hid == actorId); + if(hasHero == -1) { + heroInfos.push({ + hid: actorId, star: 6, colorStar: 6, quality: 4 + }); } } let resultHeroes = await createHeroes(roleId, roleName, sid, serverId, heroInfos);