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

@@ -1,9 +1,7 @@
// 一些通用的interface定义
import { RoleType } from "../db/Role";
import { Robot } from "../db/PvpDefense";
import { reduceCe } from "./util";
import { PvpHeroInfo, PvpEnemies } from "../db/generalField";
import { PvpEnemies } from "../db/generalField";
export interface RewardInter {
id: number;

View File

@@ -140,7 +140,7 @@ async function calculateTopFive(role: RoleType, hid: number, ce: number, heroId:
} else { // 原来就是最强5人
if (ce < topFive[topFive.length - 1].ce) { // 滑出最强
let heroes = await HeroModel.getTopHero(role.roleId, 5);
topFive = heroes.map(cur => { return { hid: cur.hid, ce: cur.ce } });
topFive = heroes.map(cur => { return { hid: cur.hid, ce: cur.ce, hero: cur._id } });
} else {
topFive[index].ce = ce;
}