fix bug 连胜次数错误
This commit is contained in:
@@ -169,7 +169,14 @@ export class PvpHandler {
|
||||
if(!curOpp) return resResult(STATUS.PVP_ROLE_NOT_FOUND);
|
||||
|
||||
const role = await RoleModel.findByRoleId(roleId);
|
||||
|
||||
const myRecInfo = await generMyRecInfo(heroScores, winStreakNum, role, isSuccess, pos, myHeroes);
|
||||
if(isSuccess) {
|
||||
winStreakNum ++;
|
||||
} else {
|
||||
winStreakNum = 0;
|
||||
}
|
||||
|
||||
let { attackInfo, showHeroScores, addSumScore } = myRecInfo
|
||||
|
||||
score += addSumScore;
|
||||
|
||||
@@ -445,12 +445,10 @@ export async function generMyRecInfo(heroScores: HeroScores[], winStreakNum: num
|
||||
showHeroScores.push({
|
||||
hid, addScore: dicOpp.score, plusScore, score: curHeroScore.score
|
||||
});
|
||||
winStreakNum++;
|
||||
} else {
|
||||
showHeroScores.push({
|
||||
hid, addScore: 0, plusScore: 0, score: curHeroScore.score
|
||||
});
|
||||
winStreakNum = 0;
|
||||
}
|
||||
const myHero = await HeroModel.findByHidAndRole(hid, roleId, 'quality star colorStar lv');
|
||||
let { quality, star, colorStar, lv } = myHero;
|
||||
@@ -472,7 +470,7 @@ export async function generMyRecInfo(heroScores: HeroScores[], winStreakNum: num
|
||||
score: isSuccess ? addSumScore : 0
|
||||
}
|
||||
|
||||
return { attackInfo, showHeroScores, winStreakNum, addSumScore }
|
||||
return { attackInfo, showHeroScores, addSumScore }
|
||||
}
|
||||
|
||||
// 获取对手战报记录
|
||||
|
||||
Reference in New Issue
Block a user