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);