镇念塔:重复上阵武将bug
This commit is contained in:
@@ -72,7 +72,7 @@ export class NormalBattleHandler {
|
||||
}
|
||||
dailyNum = Object.assign(dailyNum, checkResult.data);
|
||||
} else if (warInfo.warType == WAR_TYPE.TOWER) {
|
||||
let checkResult = await checkTowerWar(roleId, battleId, heroes);
|
||||
let checkResult = await checkTowerWar(roleId, battleId, seqIds, heroes);
|
||||
if (checkResult.status == -1) {
|
||||
return checkResult.resResult
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ export async function checkTaskRewards(roleId: string, batchCode: string, tasks:
|
||||
return { compTasks, rewards };
|
||||
}
|
||||
|
||||
export async function checkTowerWar(roleId: string, battleId: number, heroes: Array<number>) {
|
||||
export async function checkTowerWar(roleId: string, battleId: number, seqIds: number[], heroes: Array<number>) {
|
||||
let { towerLv } = await RoleModel.findByRoleId(roleId);
|
||||
const towerInfo = gameData.tower.get(towerLv);
|
||||
if (!towerInfo) {
|
||||
@@ -160,14 +160,15 @@ export async function checkTowerWar(roleId: string, battleId: number, heroes: Ar
|
||||
let { heroes: recHeroes = [], warStatus = [] } = tower;
|
||||
let dicWar = gameData.war.get(battleId);
|
||||
let { fobiddenCharactor } = dicWar;
|
||||
for (let hid of heroes) {
|
||||
for (let hid of seqIds) {
|
||||
if (recHeroes.indexOf(hid) !== -1) {
|
||||
return { status: -1, resResult: resResult(STATUS.TOWER_DUPLICATE_HERO) };
|
||||
}
|
||||
}
|
||||
for(let hid of heroes) {
|
||||
if(checkForbiddenChar(hid, fobiddenCharactor)) {
|
||||
return { status: -1, resResult: resResult(STATUS.TOWER_HERO_FORBIDDEN) };
|
||||
}
|
||||
|
||||
}
|
||||
const curWarStatus = warStatus.find(elem => elem.warId == battleId);
|
||||
if (curWarStatus && curWarStatus.status) {
|
||||
@@ -208,11 +209,13 @@ export async function towerBattleEnd(sid: string, funcs: number[], roleId: strin
|
||||
if (battleRec.battleId != battleId) {
|
||||
return { status: -1, resResult: resResult(STATUS.BATTLE_ID_NOT_MATCH) };
|
||||
}
|
||||
|
||||
let { towerLv, roleName } = await RoleModel.findByRoleId(roleId);
|
||||
let { warStatus, heroes: recHeroes } = await TowerRecordModel.getRecordByLv(roleId, towerLv);
|
||||
console.log('*******', towerLv, heroes.join(), recHeroes.join())
|
||||
for (let hid of heroes) {
|
||||
if (recHeroes.indexOf(hid) !== -1) {
|
||||
return { status: -1, resResult: resResult(STATUS.TOWER_DUPLICATE_CHALLENGE) };
|
||||
return { status: -1, resResult: resResult(STATUS.TOWER_DUPLICATE_HERO) };
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user