其他地方也添加判空处理
This commit is contained in:
@@ -259,7 +259,9 @@ async function matchRobot(chosenOpps: string[], role: RoleType, score: number, d
|
||||
let dicHero = gameData.hero.get(actorId);
|
||||
if (!dicHero) continue;
|
||||
let heroInfo = new PvpHeroInfo();
|
||||
let { attribute, ce, lv } = getRobotAttribute(actorId, ratio, score);
|
||||
let robotInfo = getRobotAttribute(actorId, ratio, score);
|
||||
if(!robotInfo) continue;
|
||||
let { attribute, ce, lv } = robotInfo;
|
||||
heroInfo.setRobotInfo(dicHero, lv);
|
||||
defCe += ce;
|
||||
heroInfo.setAttribute(attribute);
|
||||
@@ -373,6 +375,7 @@ export function refreshRefOppCnt(pvpDefense: PvpDefenseType) {
|
||||
export function getRobotAttribute(hid: number, posRatio: number, score: number) {
|
||||
|
||||
let difficultRatio = getPvpDifficultByScore(score);
|
||||
if(!difficultRatio) return null
|
||||
let dicHero = gameData.hero.get(hid);
|
||||
|
||||
let newAttribute = new AttributeCal();
|
||||
|
||||
Reference in New Issue
Block a user