修改字段初值问题

This commit is contained in:
liangtongchuan
2020-11-19 20:25:10 +08:00
parent 225d55f98f
commit c3a3314bb8
@@ -111,8 +111,8 @@ export class ComBattleHandler {
let roleStatus = new RoleStatus(); let roleStatus = new RoleStatus();
roleStatus.heroes = []; roleStatus.heroes = [];
roleStatus.isCap = false; roleStatus.isCap = false;
roleStatus.headHid = headHid || roleStatus.headHid; roleStatus.headHid = headHid || 1;
roleStatus.topFiveCe = topFiveCe || roleStatus.topFiveCe; roleStatus.topFiveCe = topFiveCe || 0;
roleStatus.roleId = roleId; roleStatus.roleId = roleId;
roleStatus.isFrd = isFrd; roleStatus.isFrd = isFrd;
const team = await ComBattleTeamModel.addRole(teamCode, roleStatus); const team = await ComBattleTeamModel.addRole(teamCode, roleStatus);
@@ -126,7 +126,7 @@ export class ComBattleHandler {
if (users.indexOf(roleId) === -1) { if (users.indexOf(roleId) === -1) {
channel.add(roleId, sid); 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.roleIds.push(roleId);
teamStatus.roleStatus.push(roleStatus); teamStatus.roleStatus.push(roleStatus);