From 64fad7e28003bf8aba04bc199e6e36ccca1e4260 Mon Sep 17 00:00:00 2001 From: mengxinzxz <2223529500@qq.com> Date: Tue, 28 Nov 2023 15:56:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96audio=E4=B8=BA=E6=95=B0?= =?UTF-8?q?=E7=BB=84=E6=97=B6=E7=9A=84skill=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/refresh.js | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/character/refresh.js b/character/refresh.js index 8cfa634c8..95324e2ed 100755 --- a/character/refresh.js +++ b/character/refresh.js @@ -10677,18 +10677,26 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } skills.forEach(skill=>{ var info=lib.skill[skill]; - if(!info.audioname2) info.audioname2={}; - if(info.audioname&&info.audioname.includes(character)){ - if(info.audio&&typeof info.audio=='string') skill=info.audio; - if(!lib.skill[skill+'_'+character]) lib.skill[skill+'_'+character]={audio:2}; - info.audioname2[name]=(skill+'_'+character); - } - else if(info.audioname2[character]){ - info.audioname2[name]=info.audioname2[character]; - } - else{ - if(info.audio&&typeof info.audio=='string') skill=info.audio; - info.audioname2[name]=skill; + if(info){ + if(!info.audioname2) info.audioname2={}; + if(info.audioname&&info.audioname.includes(character)){ + if(info.audio){ + if(typeof info.audio=='string') skill=info.audio; + if(Array.isArray(info.audio)) skill=info.audio[0]; + } + if(!lib.skill[skill+'_'+character]) lib.skill[skill+'_'+character]={audio:2}; + info.audioname2[name]=(skill+'_'+character); + } + else if(info.audioname2[character]){ + info.audioname2[name]=info.audioname2[character]; + } + else{ + if(info.audio){ + if(typeof info.audio=='string') skill=info.audio; + if(Array.isArray(info.audio)) skill=info.audio[0]; + } + info.audioname2[name]=skill; + } } }); },