寻宝:修复领取奖励问题
This commit is contained in:
@@ -544,13 +544,13 @@ export class ComBattleHandler {
|
||||
clearRobotHurtTimer(team, this.robotHurtTimer);
|
||||
if (!team || team.status !== COM_TEAM_STATUS.WIN) return resResult(STATUS.COM_BATTLE_REWARD_ERR);
|
||||
let { roleStatus, blueprtId, status, bossHpArr } = team;
|
||||
let roleSt: RoleStatus = null;
|
||||
roleStatus.forEach(st => {
|
||||
if (st && st.roleId === roleId) {
|
||||
roleSt = st;
|
||||
}
|
||||
});
|
||||
return resResult(STATUS.SUCCESS, { teamInfo: {status, teamCode, roleStatus, bossHpArr} });
|
||||
let roleSt = roleStatus.find(st => st && st.roleId === roleId);
|
||||
if(!roleSt) return resResult(STATUS.COM_BATTLE_REWARD_ERR);
|
||||
|
||||
await ComBattleTeamModel.updateRewardSt(teamCode, roleId, true);
|
||||
const goods = await addItems(roleId, roleName, sid, roleSt.rewards, ITEM_CHANGE_REASON.COM_BATTLE_END);
|
||||
|
||||
return resResult(STATUS.SUCCESS, { battleGoods: goods, teamInfo: {status, teamCode, roleStatus, bossHpArr} });
|
||||
}
|
||||
|
||||
async getComBtlStatus(msg: {teamCode: string}, session: BackendSession) {
|
||||
|
||||
@@ -261,11 +261,6 @@ export async function handleComBtlProgress(teamStatus: MemComBtlTeam, robotHurtT
|
||||
});
|
||||
for (let st of teamStatus.roleStatus) {
|
||||
st.rewards = await getRealReward(teamStatus.blueprtId, teamStatus.roleStatus, st, teamStatus.hasTimeExtraReward);
|
||||
if(!st.isRobot) {
|
||||
await addItems(st.roleId, st.roleName, st.sid, st.rewards, ITEM_CHANGE_REASON.COM_BATTLE_END);
|
||||
await ComBattleTeamModel.updateRewardSt(teamCode, st.roleId, true);
|
||||
}
|
||||
|
||||
};
|
||||
await checkTaskInComBattleEnd(teamStatus.roleStatus, teamStatus.capId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user