修改字段初值问题

This commit is contained in:
liangtongchuan
2020-11-19 14:58:11 +08:00
parent 225d55f98f
commit c3a3314bb8

View File

@@ -111,8 +111,8 @@ export class ComBattleHandler {
let roleStatus = new RoleStatus();
roleStatus.heroes = [];
roleStatus.isCap = false;
roleStatus.headHid = headHid || roleStatus.headHid;
roleStatus.topFiveCe = topFiveCe || roleStatus.topFiveCe;
roleStatus.headHid = headHid || 1;
roleStatus.topFiveCe = topFiveCe || 0;
roleStatus.roleId = roleId;
roleStatus.isFrd = isFrd;
const team = await ComBattleTeamModel.addRole(teamCode, roleStatus);
@@ -126,7 +126,7 @@ export class ComBattleHandler {
if (users.indexOf(roleId) === -1) {
channel.add(roleId, sid);
}
channel.pushMessage('onTeamJoin', {teamCode, roleInfo: {roleId, headHid, topFiveCe}});
channel.pushMessage('onTeamJoin', {teamCode, roleInfo: {roleId, headHid: roleStatus.headHid, topFiveCe: roleStatus.topFiveCe}});
teamStatus.roleIds.push(roleId);
teamStatus.roleStatus.push(roleStatus);