diff --git a/game-server/app/services/battle/rougeService.ts b/game-server/app/services/battle/rougeService.ts index 1a81bf2c2..3796de42b 100644 --- a/game-server/app/services/battle/rougeService.ts +++ b/game-server/app/services/battle/rougeService.ts @@ -903,7 +903,9 @@ export function getRandomSpirit(spiritPlan: number, randomNum: number) { const spiritPlanData = gameData.spiritPlan.get(spiritPlan); if (randomNum == 0 || !spiritPlanData || spiritPlanData.length == 0) return spiritId; let random = getRandEelmWithWeightAndNum(spiritPlanData, randomNum); - spiritId = random.map(cur => { return cur.dic.spiritId }); + for (let cur of random) { + if (cur.dic && cur.dic.spiritId) spiritId.push(cur.dic.spiritId) + } return spiritId; } @@ -940,7 +942,7 @@ export async function repaireSendScoreReward() { received.push(index); } } - if(goods.length > 0) { + if (goods.length > 0) { await sendMailByContent(MAIL_TYPE.ROUGE_SCORE_REPAIRE, roleId, { goods }); updateArr.push({ roleId, refTime, receiveNum: rougeScoreRewardByLvData.size, received }); }