修正面板变换时圣遗物套装全名可能识别错误的问题

This commit is contained in:
Kokomi 2023-10-13 15:34:52 +08:00
parent 178b5e75b9
commit c625d5ffd1
2 changed files with 2 additions and 1 deletions

View File

@ -86,7 +86,7 @@ const ProfileChange = {
// 匹配圣遗物套装 // 匹配圣遗物套装
let asMap = ArtifactSet.getAliasMap() let asMap = ArtifactSet.getAliasMap()
let asKey = lodash.keys(asMap).join('|') let asKey = lodash.keys(asMap).sort((a,b)=>b.length-a.length).join('|')
let asReg = new RegExp(`(${asKey})套?[2,4]?\\+?(${asKey})?套?[2,4]?`) let asReg = new RegExp(`(${asKey})套?[2,4]?\\+?(${asKey})?套?[2,4]?`)
let asRet = asReg.exec(txt) let asRet = asReg.exec(txt)
if (asRet && asRet[1] && asMap[asRet[1]]) { if (asRet && asRet[1] && asMap[asRet[1]]) {

View File

@ -98,6 +98,7 @@ lodash.forEach(aliasCfg, (txt, name) => {
lodash.forEach(txt.split(','), (t) => { lodash.forEach(txt.split(','), (t) => {
alias[t] = name alias[t] = name
}) })
alias[name] = name
}) })
export const aliasMap = alias export const aliasMap = alias