为removeGlobalSkill添加了参数player,对接了player.js的调用

This commit is contained in:
IceCola 2024-04-11 18:55:17 +08:00 committed by GitHub
parent 504c61f4be
commit dc35acf0d2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 1 deletions

View File

@ -4653,8 +4653,14 @@ export class Game extends Uninstantable {
} }
/** /**
* @param { string } skill * @param { string } skill
* @param { lib.element.Player } player
*/ */
static removeGlobalSkill(skill) { static removeGlobalSkill(skill, player) {
const players = lib.skill.globalmap[skill];
if(player && Array.isArray(players)) {
lib.skill.globalmap[skill].remove(player);
if(players.length) return;
}
lib.skill.global.remove(skill); lib.skill.global.remove(skill);
delete lib.skill.globalmap[skill]; delete lib.skill.globalmap[skill];
for (let i in lib.hook.globalskill) { for (let i in lib.hook.globalskill) {