🐞 fix(gvg): 修复队伍进出城池内存更新

This commit is contained in:
luying
2023-02-23 17:50:50 +08:00
parent 7300efd263
commit c3d86076ec
9 changed files with 324 additions and 216 deletions
@@ -27,7 +27,7 @@ class GVGBattleData {
let teams: GVGTeamMem[] = [];
for(let teamCode of teamCodes) {
let team = this.teams.get(teamCode);
if(team) teams.push(team);
if(team && !team.isBroken) teams.push(team);
}
return teams.slice(0, 20);
}
@@ -90,8 +90,8 @@ class GVGBattleData {
private setRolePoints(roleId: string, fromPointId: number, pointId: number, teamCode: string) {
if(fromPointId > 0 && pointId == 0) { // 被打得撤离积分点
if(this.rolePoints.has(roleId) && this.rolePoints.get(roleId).has(pointId)) {
this.rolePoints.get(roleId).delete(pointId);
if(this.rolePoints.has(roleId) && this.rolePoints.get(roleId).has(fromPointId)) {
this.rolePoints.get(roleId).delete(fromPointId);
}
} else if (fromPointId == 0 && pointId > 0) {
if(!this.rolePoints.has(roleId)) this.rolePoints.set(roleId, new Map());