fix 结算保存机器人对手等级
This commit is contained in:
@@ -182,7 +182,7 @@ export class PvpHandler {
|
||||
if(score > hisScore) hisScore = score;
|
||||
let pLv = getLvByScore(heroScores);
|
||||
|
||||
const defenseInfo = await generPVPOppRecInfo(isSuccess, curOpp, oppRoleId, oppHeroes);
|
||||
const defenseInfo = await generPVPOppRecInfo(isSuccess, curOpp, oppRoleId, oppHeroes, role.lv);
|
||||
|
||||
// 战报记录
|
||||
await PvpRecordModel.createRec({roleId1: roleId, roleId2: oppRoleId, warId: BattleRecord.battleId, attackInfo, defenseInfo});
|
||||
|
||||
@@ -487,7 +487,7 @@ export async function generMyRecInfo(heroScores: HeroScores[], winStreakNum: num
|
||||
}
|
||||
|
||||
// 获取对手战报记录
|
||||
export async function generPVPOppRecInfo(isSuccess: boolean, curOpp: OppPlayers, oppRoleId: string, oppHeroes: pvpEndParamInter[]) {
|
||||
export async function generPVPOppRecInfo(isSuccess: boolean, curOpp: OppPlayers, oppRoleId: string, oppHeroes: pvpEndParamInter[], myLv: number) {
|
||||
let oppHeroRecords = new Array<HeroesRecord>();
|
||||
for (let { hid, damage, heal, underDamage } of oppHeroes) {
|
||||
if (curOpp.isRobot) {
|
||||
@@ -506,7 +506,7 @@ export async function generPVPOppRecInfo(isSuccess: boolean, curOpp: OppPlayers,
|
||||
}
|
||||
let oppRole;
|
||||
if (curOpp.isRobot) {
|
||||
oppRole = { ...curOpp.robot, title: 1, topFiveCe: curOpp.robot.defCe };
|
||||
oppRole = { ...curOpp.robot, title: 1, topFiveCe: curOpp.robot.defCe, lv: myLv };
|
||||
} else {
|
||||
oppRole = await RoleModel.findByRoleId(oppRoleId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user