mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 19:51:08 +01:00
Fixed deletion of characters in the world locking up the party actor
This commit is contained in:
parent
63e66bd0d3
commit
013085299f
5 changed files with 36 additions and 4 deletions
|
|
@ -672,9 +672,19 @@ export default class DhCharacter extends BaseDataActor {
|
|||
if (this.companion) {
|
||||
this.companion.updateLevel(1);
|
||||
}
|
||||
|
||||
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)
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_getTags() {
|
||||
return [this.class.value?.name, this.class.subclass?.name, this.community?.name, this.ancestry?.name].filter((t) => !!t);
|
||||
return [this.class.value?.name, this.class.subclass?.name, this.community?.name, this.ancestry?.name].filter(
|
||||
t => !!t
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ export default class DhParty extends BaseDataActor {
|
|||
// Register this party to all members
|
||||
if (game.actors.get(this.parent.id) === this.parent) {
|
||||
for (const member of this.partyMembers) {
|
||||
member.parties?.add(this.parent);
|
||||
member?.parties?.add(this.parent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -42,7 +42,7 @@ export default class DhParty extends BaseDataActor {
|
|||
|
||||
// Clear this party from all members that aren't deleted
|
||||
for (const member of this.partyMembers) {
|
||||
member.parties?.delete(this.parent);
|
||||
member?.parties?.delete(this.parent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue