Skip to content

Commit

Permalink
修正自定义属性解析报错
Browse files Browse the repository at this point in the history
  • Loading branch information
sumneko committed May 9, 2024
1 parent 33c8a49 commit c14ef24
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/customDefine/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class Events extends BaseDefine {
if (Array.isArray(json.group_info)) {
for (let item of json.group_info) {
let id = item.items?.[0];
let name = decodeURI(item.items?.[1]);
let name = item.items?.[1];
if (id && name) {
events.push({name, id: id, args: []});
}
Expand All @@ -67,7 +67,7 @@ export class Events extends BaseDefine {
continue;
}
for (let item of conf) {
let name = decodeURI(item[0]);
let name = item[0];
let type = item[1];
if (name && type) {
event.args.push({
Expand Down
2 changes: 1 addition & 1 deletion src/customDefine/playerAttrs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export class PlayerAttrs extends BaseDefine {
return attrs;
}
for (let item of json.role_res_types) {
let name = decodeURI(item.items?.[1]?.name);
let name = item.items?.[1]?.name;
let key = item.items?.[1]?.key;
if (name && key) {
attrs.push({name, key});
Expand Down
4 changes: 2 additions & 2 deletions src/customDefine/unitAttrs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export class UnitAttrs extends BaseDefine {
// 自定义单位属性
if (Array.isArray(json.c)) {
for (let item of json.c) {
let name = decodeURI(item.items?.[1]?.desc);
let name = item.items?.[1]?.desc;
let key = item.items?.[1]?.key;
if (name && key && !mark.has(key)) {
attrs.push({name, key});
Expand All @@ -57,7 +57,7 @@ export class UnitAttrs extends BaseDefine {
// 复合属性
if (Array.isArray(json.p)) {
for (let item of json.p) {
let name = decodeURI(item.items?.[1]?.d);
let name = item.items?.[1]?.d;
let key = item.items?.[1]?.k;
if (name && key && !mark.has(key)) {
attrs.push({name, key});
Expand Down

0 comments on commit c14ef24

Please sign in to comment.