若nameinfo[0]没有对应的剪影素材,则剪影全为male
This commit is contained in:
parent
5813592342
commit
4898cf38fb
|
@ -196,7 +196,7 @@ Reflect.defineProperty(HTMLDivElement.prototype, 'setBackground', {
|
|||
this.style.backgroundSize = 'cover';
|
||||
if (type === 'character') {
|
||||
const nameinfo = get.character(name);
|
||||
const sex = nameinfo ? nameinfo[0] : 'male';
|
||||
const sex = nameinfo && ['male', 'female', 'double'].includes(nameinfo[0]) ? nameinfo[0] : 'male';
|
||||
this.setBackgroundImage([
|
||||
src,
|
||||
`${lib.characterDefaultPicturePath}${sex}${ext}`
|
||||
|
|
Loading…
Reference in New Issue