修正圣遗物旧格式兼容可能导致的报错

This commit is contained in:
Kokomi 2023-02-10 01:17:18 +08:00
parent a76b7d98a9
commit 673d813f6f
4 changed files with 6 additions and 3 deletions

View File

@ -31,7 +31,7 @@ export default class AvatarArtis extends Base {
if (!this.hasArtis || AvatarArtis.isProfileArtis(ds) || !AvatarArtis.isProfileArtis(this.artis)) { if (!this.hasArtis || AvatarArtis.isProfileArtis(ds) || !AvatarArtis.isProfileArtis(this.artis)) {
for (let idx = 1; idx <= 5; idx++) { for (let idx = 1; idx <= 5; idx++) {
if (ds[idx]) { if (ds[idx]) {
this.setArtis(idx, ds[idx] || {}) this.setArtis(idx, ds[idx] || ds[`arti${idx}`] || {})
} }
} }
return true return true

View File

@ -62,7 +62,7 @@ export default class ProfileReq extends Base {
let reqParam = await serv.getReqParam(this.uid) let reqParam = await serv.getReqParam(this.uid)
let cdTime = await this.inCd() let cdTime = await this.inCd()
if (cdTime) { if (cdTime) {
// return this.err(`请求过快,请${cdTime}秒后重试..`) return this.err(`请求过快,请${cdTime}秒后重试..`)
} }
await this.setCd(20) await this.setCd(20)
this.msg(`开始获取uid:${this.uid}的数据,可能会需要一定时间~`) this.msg(`开始获取uid:${this.uid}的数据,可能会需要一定时间~`)

View File

@ -166,7 +166,7 @@ let ArtisMark = {
getMark (charCfg, posIdx, mainAttr, subAttr, elem = '') { getMark (charCfg, posIdx, mainAttr, subAttr, elem = '') {
let ret = 0 let ret = 0
let { attrs, posMaxMark } = charCfg let { attrs, posMaxMark } = charCfg
let key = mainAttr.key let key = mainAttr?.key
let fixPct = 1 let fixPct = 1
posIdx = posIdx * 1 posIdx = posIdx * 1
if (posIdx >= 3) { if (posIdx >= 3) {

View File

@ -181,6 +181,9 @@ class AttrCalc {
* @returns {boolean} * @returns {boolean}
*/ */
calcArtisAttr (ds, char) { calcArtisAttr (ds, char) {
if (!ds) {
return false
}
let key = ds.key let key = ds.key
if (Format.isElem(key) && char.elem === key) { if (Format.isElem(key) && char.elem === key) {
key = 'dmg' key = 'dmg'