修正历史错误数据可能导致面板统计错误的问题

This commit is contained in:
Kokomi 2022-09-08 17:38:15 +08:00
parent e58721d1b9
commit 6c8952c885
3 changed files with 10 additions and 4 deletions

View File

@ -44,8 +44,11 @@ export async function profileStat (e) {
avatar.aeq = talent?.a?.original + talent?.e?.original + talent?.q?.original || 3
avatarRet.push(avatar)
if (profiles[id]) {
let mark = profiles[id].getArtisMark(false)
avatar.artisMark = Data.getData(mark, 'mark,markClass,names')
let profile = profiles[id]
if(profile.hasData) {
let mark = profiles[id].getArtisMark(false)
avatar.artisMark = Data.getData(mark, 'mark,markClass,names')
}
}
})

View File

@ -203,7 +203,7 @@ class Character extends Base {
if (CharId.isTraveler(avatar.id)) {
let char = Character.get({
id: avatar.id,
elem: (avatar.elem || avatar.element).toLowerCase() || 'anemo'
elem: (avatar.elem || avatar.element || 'anemo').toLowerCase()
})
char.setTraveler(uid)
return char

View File

@ -125,7 +125,10 @@ export default class ProfileData extends Base {
// 获取当前profileData的圣遗物评分withDetail=false仅返回简略信息
getArtisMark (withDetail = true) {
return this.artis.getMarkDetail(withDetail)
if(this.hasData) {
return this.artis.getMarkDetail(withDetail)
}
return {}
}
// 计算当前profileData的伤害信息