fix 刷新对手无法找到武将

This commit is contained in:
luying
2021-01-14 18:37:13 +08:00
parent 9eaecf3a28
commit 13570982f4
5 changed files with 47 additions and 45 deletions

View File

@@ -138,7 +138,7 @@ export async function matchPlayerByRank(oppPlayers: OppPlayers[], mapWarJson: Di
if(result.length <= 0) return false;
oppRoleId = result[0];
let pvpdefense = await PvpDefenseModel.findByRoleId(oppRoleId);
let pvpdefense = await PvpDefenseModel.findByRoleIdIncludeAll(oppRoleId);
let pvpHistoryOpp = await generPlayerOppHis(pvpdefense, mapWarJson, roleId, pos);
oppPlayers.push({
@@ -192,8 +192,8 @@ async function generPlayerOppHis(result: PvpDefenseType, mapWarJson: DicWarJson[
for(let warJson of mapWarJson) {
if(warJson.relation == 1) continue;
let h = result.heroes.find(cur => cur.dataId == warJson.dataId);
if(h) {
let hs = heroScores.find(cur => cur.hid == warJson.actorId); // 这个武将的军功
if(h && h.hero) {
let hs = heroScores.find(cur => cur.hid == h.actorId); // 这个武将的军功
let hero = <HeroType>h.hero;
let heroInfo = new PvpHeroInfo();
heroInfo.setHeroInfo(hero);