Merge pull request #609 from kuangshen04/PR-Branch

Fix some remove
This commit is contained in:
Spmario233 2023-11-03 23:24:18 +08:00 committed by GitHub
commit b5197a430d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -27566,7 +27566,8 @@
} }
else{ else{
for(var i in this.forbiddenSkills){ for(var i in this.forbiddenSkills){
if(this.forbiddenSkills[i].remove(skill)){ if(this.forbiddenSkills[i].includes(skill)){
this.forbiddenSkills[i].remove(skill)
if(!this.forbiddenSkills[i].length){ if(!this.forbiddenSkills[i].length){
delete this.forbiddenSkills[i]; delete this.forbiddenSkills[i];
} }

View File

@ -1667,7 +1667,9 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
if(ban_identity.length){ if(ban_identity.length){
var identityList2=identityList.slice(0); var identityList2=identityList.slice(0);
for(var i=0;i<ban_identity.length;i++){ for(var i=0;i<ban_identity.length;i++){
while(identityList2.remove(ban_identity[i])); while(identityList2.includes(ban_identity[i])){
identityList2.remove(ban_identity[i]);
}
} }
ban_identity=identityList2.randomGet(); ban_identity=identityList2.randomGet();
identityList.remove(ban_identity); identityList.remove(ban_identity);