[Fix] Party And Effect Minifixes (#1337)

* .

* Added migration to remove ghosts from the TagTeamDialog
This commit is contained in:
WBHarry 2025-11-25 23:20:07 +01:00 committed by GitHub
parent d616ddc113
commit 44b805d0df
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 55 additions and 2 deletions

View file

@ -36,6 +36,23 @@ export default class DhParty extends BaseDataActor {
}
}
async _preDelete() {
/* Clear all partyMembers from tagTeam setting.*/
/* Revisit this when tagTeam is improved for many parties */
const tagTeam = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.TagTeamRoll);
await tagTeam.updateSource({
initiator: this.partyMembers.some(x => x.id === tagTeam.initiator) ? null : tagTeam.initiator,
members: Object.keys(tagTeam.members).reduce((acc, key) => {
if (this.partyMembers.find(x => x.id === key)) {
acc[`-=${key}`] = null;
}
return acc;
}, {})
});
await game.settings.set(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.TagTeamRoll, tagTeam);
}
_onDelete(options, userId) {
super._onDelete(options, userId);