🐞 fix(gvg): 挑战方挑战期间也不可被挑战

This commit is contained in:
luying
2023-03-22 15:49:32 +08:00
parent 4061612a2c
commit d67f7df302
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -248,7 +248,7 @@ export default class GVGTeam extends BaseModel {
// 攻击方攻击cd
public static async battleStartLockAttack(teamCode: string) {
const team: GVGTeamType = await GVGTeamModel.findOneAndUpdate({ teamCode }, { $set: { attackTime: nowSeconds() + GVG.GVG_DEFAULT_ATTACK_CD } }, { new: true }).lean();
const team: GVGTeamType = await GVGTeamModel.findOneAndUpdate({ teamCode }, { $set: { attackTime: nowSeconds() + GVG.GVG_DEFAULT_ATTACK_CD, lockTime: nowSeconds() + GVG.GVG_DEFAULT_BATTLE_CD, lockTeamCode: teamCode } }, { new: true }).lean();
return team;
}
@@ -266,7 +266,7 @@ export default class GVGTeam extends BaseModel {
// 结算挑战方
public static async battleEndAttack(teamCode: string, hpInc: number, rebirthAreaId: number, reviveCd: number) {
let team: GVGTeamType = await GVGTeamModel.findOneAndUpdate({ teamCode }, { $inc: { durability: hpInc } }, { new: true }).lean();
let team: GVGTeamType = await GVGTeamModel.findOneAndUpdate({ teamCode }, { $inc: { durability: hpInc }, $set: { lockTime: 0, lockTeamCode: '' } }, { new: true }).lean();
if(team.durability <= 0) {
let originPointId = team.pointId;
team = await GVGTeamModel.teamBreak(teamCode, team.isRobot, team.maxDurability, rebirthAreaId, team.areaId, reviveCd);