🐞 fix(gvg): 修复攻打掉占领据点的队伍时的数据错误
This commit is contained in:
@@ -104,11 +104,12 @@ class GVGBattleData {
|
||||
}
|
||||
|
||||
private setRolePoints(roleId: string, fromPointId: number, pointId: number, teamCode: string) {
|
||||
if(fromPointId > 0 && pointId == 0) { // 被打得撤离积分点
|
||||
if(fromPointId > 0) { // 被打得撤离积分点
|
||||
if(this.rolePoints.has(roleId) && this.rolePoints.get(roleId).has(fromPointId)) {
|
||||
this.rolePoints.get(roleId).delete(fromPointId);
|
||||
}
|
||||
} else if (fromPointId == 0 && pointId > 0) {
|
||||
}
|
||||
if (pointId > 0) {
|
||||
if(!this.rolePoints.has(roleId)) this.rolePoints.set(roleId, new Map());
|
||||
this.rolePoints.get(roleId).set(pointId, teamCode);
|
||||
}
|
||||
|
||||
@@ -218,7 +218,6 @@ export async function generNewLineup(roleId: string, heroes: HeroType[], lineup:
|
||||
*/
|
||||
export async function leaveCity(isForce: boolean, roleId: string, serverId: number, guildCode: string, myLeague?: GVGLeagueType) {
|
||||
if(!myLeague) myLeague = await GVGLeagueModel.findLeagueByGuild(guildCode);
|
||||
if(!myLeague) return;
|
||||
let groupKey = await getGroupKey(serverId);
|
||||
let { configId } = getGVGConfig();
|
||||
let teams = await GVGTeamModel.findByRole(roleId);
|
||||
@@ -227,7 +226,7 @@ export async function leaveCity(isForce: boolean, roleId: string, serverId: numb
|
||||
if(isForce || !hasPoint) {
|
||||
await GVGTeamModel.leaveCity(roleId);
|
||||
await GVGCityModel.decreasePlayer(configId, groupKey, roleId);
|
||||
await GVGUserDataModel.changeCity(configId, myLeague.leagueCode, roleId, 0);
|
||||
if(myLeague) await GVGUserDataModel.changeCity(configId, myLeague.leagueCode, roleId, 0);
|
||||
await GVGCityAreaPointModel.playerLeave(configId, groupKey, roleId);
|
||||
// 处理内存数据
|
||||
let teamObj = getGVGBattleData(groupKey);
|
||||
|
||||
Reference in New Issue
Block a user