diff --git a/game-server/app/services/pvpService.ts b/game-server/app/services/pvpService.ts index 844aba7cf..2072874e0 100644 --- a/game-server/app/services/pvpService.ts +++ b/game-server/app/services/pvpService.ts @@ -187,8 +187,10 @@ async function matchPlayer(groupId: number, seasonNum: number, chosenOpps: strin // console.log('matchPlayer', JSON.stringify(oppPlayers)) let serverIds = await getPvpServersByGroupId(groupId); - let { id: pos, minLv, maxLv } = dicOpp - let range = await PvpDefenseModel.findByTeamLv(serverIds, seasonNum, pLv + minLv, pLv + maxLv); + let { id: pos, minLv, maxLv } = dicOpp; + let min = pLv + minLv > 1? pLv + minLv: 1; + let max = pLv + maxLv > 1? pLv + maxLv: 1; + let range = await PvpDefenseModel.findByTeamLv(serverIds, seasonNum, min, max); range = range.filter(cur => { return chosenOpps.indexOf(makeRobotId(cur.roleId)) == -1; });