🐞 fix(gvg): 离开城池的时候未解锁

This commit is contained in:
luying
2023-03-09 16:44:57 +08:00
parent 93e7711577
commit 58a4267f94
5 changed files with 31 additions and 25 deletions
@@ -86,12 +86,13 @@ class GVGBattleData {
this.leagueToTeam.get(team.leagueCode).add(team.teamCode);
}
this.setAreaMap(team.teamCode, fromAreaId, team.areaId);
this.setAreaMap(team.teamCode, fromAreaId, team.areaId, 'enterCity');
}
}
private setAreaMap(teamCode: string, fromAreaId: number, toAreaId: number) {
private setAreaMap(teamCode: string, fromAreaId: number, toAreaId: number, fromFun) {
if(fromAreaId == toAreaId) return;
// console.log('#### gvgBattleMemory setAreaMap', 'teamCode:', teamCode, 'fromAreaId: ', fromAreaId, 'toAreaId:', toAreaId, 'appid', pinus.app.getServerId(), 'from', fromFun)
let fromAreaSet = this.areaToTeams.get(fromAreaId);
if(fromAreaSet && fromAreaSet.has(teamCode)) fromAreaSet.delete(teamCode);
@@ -119,7 +120,7 @@ class GVGBattleData {
let team = this.teams.get(teamCode);
if(!team) return;
team.moveToArea(areaId, fromAreaId, startMoveTime, stopMoveTime);
this.setAreaMap(teamCode, fromAreaId, areaId);
this.setAreaMap(teamCode, fromAreaId, areaId, 'move');
}
public setTime(teamCode: string, teamUpdate: GVGTeamType) {
@@ -149,7 +150,7 @@ class GVGBattleData {
let { areaId: fromAreaId, pointId: originPointId } = teamMem;
teamMem.updateTeam(team);
this.setRolePoints(team.roleId, originPointId, curTeamBreak? 0: pointId, team.teamCode);
this.setAreaMap(team.teamCode, fromAreaId, team.areaId);
this.setAreaMap(team.teamCode, fromAreaId, team.areaId, 'battleEnd');
}
}