寻宝:定时触发的事件需检查最新状态

This commit is contained in:
liangtongchuan
2021-02-08 16:16:04 +08:00
parent 13bfd4ed52
commit 52ecb5e282
2 changed files with 3 additions and 1 deletions

View File

@@ -187,7 +187,8 @@ export class ComBattleHandler {
for(let robotIdx = 0; robotIdx < robotCnt; robotIdx++) {
const joinTime = getRandValueByMinMax(COM_BTL_CONST.MIN_CAP_TIME, COM_BTL_CONST.MAX_CAP_TIME, 0);
setTimeout(async () => {
if (teamStatus.status === COM_TEAM_STATUS.DEFAULT && teamStatus.roleIds.length < 3) {
teamStatus = thiz.teamMap.get(teamCode);
if (teamStatus && teamStatus.status === COM_TEAM_STATUS.DEFAULT && teamStatus.roleIds.length < 3) {
let { robotStArr, robotIdArr } = getRandComBtlRobots(topFiveCe, teamStatus.ceLimit, lv, 1);
teamStatus.roleIds = teamStatus.roleIds.concat(robotIdArr);
teamStatus.roleStatus = teamStatus.roleStatus.concat(robotStArr);