fix bug 远征关卡最后一关获取失败
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Application, BackendSession } from 'pinus';
|
||||
import { getGamedata, getWarById } from '../../../pubUtils/gamedata';
|
||||
import { getGamedata, getWarById, hasExpeditionById } from '../../../pubUtils/gamedata';
|
||||
import { BattleRecordModel } from '../../../db/BattleRecord';
|
||||
import { ExpeditionRecordModel } from '../../../db/ExpeditionRecord';
|
||||
import { ExpeditionWarRecordModel } from '../../../db/ExpeditionWarRecord';
|
||||
@@ -125,8 +125,11 @@ export class ExpeditionBattleHandler {
|
||||
}
|
||||
let { battleId, enemyFrom, enemies, battleStatus, ce: curCe } = curExpeditionWarRecord;
|
||||
let nextCe = 0; // 下一关战力
|
||||
let nextExpeditionWarRecord = await findOrCreateEnemies(roleId, myCe, expeditionCode, expeditionId + 1, EXPEDITION_WAR_RECORD_STATUS.HIDE);
|
||||
if(nextExpeditionWarRecord) nextCe = nextExpeditionWarRecord.ce;
|
||||
|
||||
if(hasExpeditionById(expeditionId + 1)) {
|
||||
let nextExpeditionWarRecord = await findOrCreateEnemies(roleId, myCe, expeditionCode, expeditionId + 1, EXPEDITION_WAR_RECORD_STATUS.HIDE);
|
||||
if(nextExpeditionWarRecord) nextCe = nextExpeditionWarRecord.ce;
|
||||
}
|
||||
|
||||
return resResult(STATUS.SUCCESS, {
|
||||
expeditionCode, expeditionId, battleId,
|
||||
|
||||
Reference in New Issue
Block a user