装备:装备精炼读取数据问题

This commit is contained in:
luying
2022-05-09 18:50:50 +08:00
parent 274783ad25
commit c83f4737e6
2 changed files with 5 additions and 2 deletions
+3 -1
View File
@@ -403,9 +403,11 @@ export async function getSumCe(roleId: string, num: number) {
export async function getHeroesAttributes(roleId: string) { export async function getHeroesAttributes(roleId: string) {
let roleCe = await RoleCeModel.findByRoleId(roleId); let roleCe = await RoleCeModel.findByRoleId(roleId);
let attrByHid = new Map<number, AttributeCal>(); let attrByHid = new Map<number, AttributeCal>();
let heroAttrs = roleCe?.heroAttrs??[];
for(let { hid, attrs } of roleCe?.attributes??[]) { for(let { hid, attrs } of roleCe?.attributes??[]) {
let cal = new AttributeCal(); let cal = new AttributeCal();
cal.setLv(roleCe.roleLv); let heroAttr = heroAttrs.find(cur => cur.hid == hid);
if(heroAttr) cal.setLv(heroAttr.lv);
cal.setByWarJson(attrs); cal.setByWarJson(attrs);
attrByHid.set(hid, cal); attrByHid.set(hid, cal);
} }
+2 -1
View File
@@ -852,10 +852,11 @@ export function getEquipStarAttrByStage(equipId: number, star: number, starStage
} }
} }
} else { } else {
let preEquipStar = getPreEquipStar(equipId, star);
let equipStar = getEquipStarIdByEquipId(equipId, star); let equipStar = getEquipStarIdByEquipId(equipId, star);
return { return {
mainAttr: equipStar.mainAttr.get(starStage), mainAttr: equipStar.mainAttr.get(starStage),
subAttr: equipStar.subAttr, subAttr: preEquipStar?.subAttr||[],
} }
} }
} }