🐞 fix(gvg): 遗迹排名变化后刷新对手
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user