This commit is contained in:
WBHarry 2025-11-14 08:43:51 +01:00
parent 013085299f
commit cd8e9f5f12
7 changed files with 66 additions and 44 deletions

View file

@ -85,6 +85,17 @@ export default class DhpActor extends Actor {
this.updateSource({ prototypeToken });
}
/**@inheritdoc */
async _preDelete() {
if (this.parent.parties) {
for (const party of this.parent.parties) {
await party.update({
'system.partyMembers': party.system.partyMembers.filter(x => x.uuid !== this.parent.uuid)
});
}
}
}
_onUpdate(changes, options, userId) {
super._onUpdate(changes, options, userId);
for (const party of this.parties) {