diff --git a/noname/init/polyfill.js b/noname/init/polyfill.js index 1c685b50b..51fc9a8ce 100644 --- a/noname/init/polyfill.js +++ b/noname/init/polyfill.js @@ -142,17 +142,14 @@ Reflect.defineProperty(HTMLDivElement.prototype, "setBackground", { gzbool = false; const mode = get.mode(); if (type == "character") { + nameinfo = get.character(name); if (lib.characterPack[`mode_${mode}`] && lib.characterPack[`mode_${mode}`][name]) { if (mode == "guozhan") { - nameinfo = lib.character[name]; if (name.startsWith("gz_shibing")) name = name.slice(3, 11); else { - if ( - lib.config.mode_config.guozhan.guozhanSkin && - lib.character[name] && - lib.character[name].hasSkinInGuozhan - ) + if (lib.config.mode_config.guozhan.guozhanSkin && nameinfo && nameinfo.hasSkinInGuozhan){ gzbool = true; + } name = name.slice(3); } } else modeimage = mode; @@ -161,8 +158,6 @@ Reflect.defineProperty(HTMLDivElement.prototype, "setBackground", { name = name.split("::"); modeimage = name[0]; name = name[1]; - } else { - nameinfo = get.character(name); } } let imgPrefixUrl;