(远征): 修复次级属性表超过等级的数据报错
This commit is contained in:
@@ -281,6 +281,7 @@ export async function getResetRemainCnt(curTime: Date, roleId: string, role?: Ro
|
|||||||
let newAttribute = new AttributeCal();
|
let newAttribute = new AttributeCal();
|
||||||
newAttribute.setLv(_lv);
|
newAttribute.setLv(_lv);
|
||||||
let dicExpeditionSubAttr = gameData.expeditionSubAttr.get(_lv);
|
let dicExpeditionSubAttr = gameData.expeditionSubAttr.get(_lv);
|
||||||
|
if(!dicExpeditionSubAttr) dicExpeditionSubAttr = gameData.expeditionSubAttr.get('max');
|
||||||
newAttribute.setByWarJson(dicExpeditionSubAttr.attribute); // 次级属性
|
newAttribute.setByWarJson(dicExpeditionSubAttr.attribute); // 次级属性
|
||||||
|
|
||||||
let subAttrCe = newAttribute.calSubAttrCe() * enemyCount;
|
let subAttrCe = newAttribute.calSubAttrCe() * enemyCount;
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ const DicExpeditionSubAttrKeys: KeysEnum<DicExpeditionSubAttr> = {
|
|||||||
attribute: true,
|
attribute: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const dicExpeditionSubAttr = new Map<number, DicExpeditionSubAttr>();
|
export const dicExpeditionSubAttr = new Map<number|'max', DicExpeditionSubAttr>();
|
||||||
export function loadExpeditionSubAttr() {
|
export function loadExpeditionSubAttr() {
|
||||||
dicExpeditionSubAttr.clear();
|
dicExpeditionSubAttr.clear();
|
||||||
let l = 1;
|
let l = 1;
|
||||||
@@ -25,6 +25,7 @@ export function loadExpeditionSubAttr() {
|
|||||||
o.lv = o.level;
|
o.lv = o.level;
|
||||||
for(let i = l; i <= o.lv; i++) {
|
for(let i = l; i <= o.lv; i++) {
|
||||||
dicExpeditionSubAttr.set(l, _.pick(o, Object.keys(DicExpeditionSubAttrKeys)));
|
dicExpeditionSubAttr.set(l, _.pick(o, Object.keys(DicExpeditionSubAttrKeys)));
|
||||||
|
dicExpeditionSubAttr.set('max', _.pick(o, Object.keys(DicExpeditionSubAttrKeys)));
|
||||||
l++;
|
l++;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user