修复removeAdditionalSkill(s)在additionalSkills[skill]为空时不删除additionalSkills[skill]的bug

This commit is contained in:
mengxinzxz 2024-02-22 18:39:09 +08:00
parent a5b4c54bf0
commit 8a46eeaf9d
1 changed files with 2 additions and 2 deletions

View File

@ -7462,7 +7462,7 @@ export class Player extends HTMLDivElement {
const player = this, skills = this.getRemovableAdditionalSkills(skill, target);
if(skills.length){
player.removeSkill(skills);
if (player.additionalSkills[skill]&&player.additionalSkills[skill].length) delete player.additionalSkills[skill];
if (player.additionalSkills[skill]&&!player.additionalSkills[skill].length) delete player.additionalSkills[skill];
}
_status.event.clearStepCache();
return this;
@ -7475,7 +7475,7 @@ export class Player extends HTMLDivElement {
return '#g【' + get.translation(i) + '】';
}));
player.removeSkill(skills);
if (player.additionalSkills[skill]&&player.additionalSkills[skill].length) delete player.additionalSkills[skill];
if (player.additionalSkills[skill]&&!player.additionalSkills[skill].length) delete player.additionalSkills[skill];
});
}
}