mirror of
https://github.com/yoimiya-kokomi/miao-plugin.git
synced 2024-11-16 04:35:42 +00:00
修正角色id查询的一处错误
This commit is contained in:
parent
be044356f8
commit
243d1087e9
@ -104,19 +104,23 @@ let getMeta = function (name) {
|
||||
|
||||
Character.get = function (val) {
|
||||
let roleid, name;
|
||||
if (typeof (val) === "number") {
|
||||
if (typeof (val) === "number" || /^\d*$/.test(val)) {
|
||||
roleid = val;
|
||||
} else if (val.id) {
|
||||
roleid = val.id;
|
||||
name = val.name || YunzaiApps.mysInfo['roleIdToName'](roleid, true);
|
||||
} else {
|
||||
roleid = YunzaiApps.mysInfo['roleIdToName'](val);
|
||||
|
||||
}
|
||||
if (!name) {
|
||||
name = YunzaiApps.mysInfo['roleIdToName'](roleid, true);
|
||||
}
|
||||
if (!name) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return new Character(name, roleid);
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user