给战力增加默认值防止缺少字段

This commit is contained in:
liangtongchuan
2020-12-01 11:45:19 +08:00
parent dd29d0dd44
commit 0dd3a3c931
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ export function getRandComBtlRobots(topFiveCe: number, lv: number, cnt: number)
// 创建并添加机器人
let robotStArr = [], robotIdArr = [];
for (let robot of robotHeroes) {
const robotCe = getRandValue(topFiveCe, COM_BATTLE_ROBOT_CE_RATIO, 0);
const robotCe = getRandValue(topFiveCe || 0, COM_BATTLE_ROBOT_CE_RATIO, 0);
const robotLv = getRandValue(lv, COM_BATTLE_ROBOT_CE_RATIO, 0);
const imgHid = robot[Math.floor(Math.random() * robot.length)];
const { robotRoleId, robotRoleName } = COM_BATTLE_ROBOT_ID_NAME[Math.floor(Math.random() * COM_BATTLE_ROBOT_ID_NAME.length)];