fix bug 远征显示下一关等

This commit is contained in:
luying
2020-11-17 17:37:05 +08:00
parent 0e2f043f93
commit 80b8f1bac7
13 changed files with 73 additions and 49 deletions
@@ -30,8 +30,12 @@ export async function roleLevelup(roleId: string, kingExp: number) {
export async function checkBattleHeroes(roleId: string, heroes: Array<number>) {
let flag = true;
if(heroes.length <= 0) flag = false;
const findHeroes = await HeroModel.findBySeqIdRange(heroes, roleId);
if(findHeroes.length != heroes.length) flag = false;
for(let seqId of heroes) {
let hero = await HeroModel.findBySeqIdAndRole(seqId||0, roleId);
let hero = findHeroes.find(cur => cur.seqId == seqId);
if(!hero) flag = false;
}
return flag;