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

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) {
let roleCe = await RoleCeModel.findByRoleId(roleId);
let attrByHid = new Map<number, AttributeCal>();
let heroAttrs = roleCe?.heroAttrs??[];
for(let { hid, attrs } of roleCe?.attributes??[]) {
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);
attrByHid.set(hid, cal);
}