Merge pull request #498 from universe-st/PR-Branch

修复checkMod有概率报错的问题。
This commit is contained in:
Spmario233 2023-10-10 21:47:31 +08:00 committed by GitHub
commit bc3cfea792
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 1 deletions

View File

@ -40752,7 +40752,17 @@
checkMod:function(){
const argumentArray=Array.from(arguments),name=argumentArray[argumentArray.length-2];
let skills=argumentArray[argumentArray.length-1];
if(skills.getSkills) skills=skills.getModableSkills(_status.event.useCache === true);
if(typeof skills.getModableSkills == 'function'){
skills=skills.getModableSkills(_status.event.useCache === true);
}else if(typeof skills.getSkills == 'function'){
skills=skills.getSkills().concat(lib.skill.global);
game.expandSkills(skills);
skills = skills.filter(function(skill){
var info = get.info(skill);
return info && info.mod;
});
skills.sort((a,b)=>get.priority(a)-get.priority(b));
}
const arg=argumentArray.slice(0,-2);
skills.forEach(value=>{
var mod = get.info(value).mod[name];