🐞 fix(gvg): 遗迹排名变化后刷新对手

This commit is contained in:
luying
2023-02-22 15:25:00 +08:00
parent cddeb71f3d
commit ed6bd1e8d5
2 changed files with 6 additions and 2 deletions
@@ -274,7 +274,7 @@ export function getVestigeRecStatus(rec: GVGVestigeRecType) {
}
// 将开始战斗时候的阵容存到防守阵容
export async function updateMyVestigeRank(isChange: boolean, atkData: GVGVestigeRankType, historyRank: number, rec: GVGVestigeRecType) {
export async function updateMyVestigeRank(isChange: boolean, atkData: GVGVestigeRankType, defData: GVGVestigeRankType, historyRank: number, rec: GVGVestigeRecType) {
let update: GVGVestigeRankUpdate = {}, needUpdate = false;
if(isChange) {
if(atkData && !atkData.hasDefense) { // 只有第一次挑战且自己没有主动保存过阵容的时候才会这么保存
@@ -297,6 +297,10 @@ export async function updateMyVestigeRank(isChange: boolean, atkData: GVGVestige
if(needUpdate) {
atkData = await GVGVestigeRankModel.updateByRoleId(atkData.vestigeId, atkData.roleId, update);
}
if(isChange && defData) {
let oppRanks = refreshVestigeOppRanks(defData.rank);
defData = await GVGVestigeRankModel.updateByRoleId(defData.vestigeId, defData.roleId, { oppRanks });
}
return atkData
}