perf: direct determination in object filter.

This commit is contained in:
Rintim 2023-10-08 12:49:46 +08:00
parent 3a493a3306
commit c370663f08
No known key found for this signature in database
GPG Key ID: BE9E1EA615BACFCF
1 changed files with 4 additions and 2 deletions

View File

@ -35040,7 +35040,8 @@
if(Array.isArray(audioInfo)){ if(Array.isArray(audioInfo)){
audioName=audioInfo[0]; audioName=audioInfo[0];
if(!fixedNum) fixedNum=audioInfo[1];//数组会取第一个指定语音数 if(!fixedNum) fixedNum=audioInfo[1];//数组会取第一个指定语音数
audioInfo=lib.skill[audioName].audio; if(audioName in lib.skill) audioInfo=lib.skill[audioName].audio;
else audioInfo=parseInt(fixedNum);
continue; continue;
} }
break; break;
@ -35077,7 +35078,8 @@
game.playAudio('skill',`${audioName}${Math.floor(audioInfo*Math.random())+1}`); game.playAudio('skill',`${audioName}${Math.floor(audioInfo*Math.random())+1}`);
} }
//直接指定配音文件名的新格式 //直接指定配音文件名的新格式
else if(typeof audioInfo=="object"&&"type" in audioInfo&&audioInfo.type=="direct"&&"files" in audioInfo){ else if(typeof audioInfo=="object"){
if(!("type" in audioInfo&&audioInfo.type=="direct"&&"files" in audioInfo)) return;
let audioFiles=audioInfo.files; let audioFiles=audioInfo.files;
if(typeof audioFiles!="object") return; if(typeof audioFiles!="object") return;
if(!Array.isArray(audioFiles)){ if(!Array.isArray(audioFiles)){