mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-17 23:49:02 +01:00
Fixed so Class/Subclass features are properly deleted on delevel
This commit is contained in:
parent
e6a855b3da
commit
ac16b00271
1 changed files with 10 additions and 3 deletions
|
|
@ -151,11 +151,18 @@ export default class DhpActor extends Actor {
|
|||
}
|
||||
|
||||
if (multiclass) {
|
||||
const multiclassSubclass = this.items.find(x => x.type === 'subclass' && x.system.isMulticlass);
|
||||
const multiclassItem = this.items.find(x => x.uuid === multiclass.itemUuid);
|
||||
const multiclassFeatures = this.items.filter(
|
||||
x => x.system.originItemType === 'class' && x.system.identifier === 'multiclass'
|
||||
);
|
||||
const subclassFeatures = this.items.filter(
|
||||
x => x.system.originItemType === 'subclass' && x.system.identifier === 'multiclass'
|
||||
);
|
||||
|
||||
multiclassSubclass.delete();
|
||||
multiclassItem.delete();
|
||||
this.deleteEmbeddedDocuments(
|
||||
'Item',
|
||||
[multiclassItem, ...multiclassFeatures, ...subclassFeatures].map(x => x.id)
|
||||
);
|
||||
|
||||
this.update({
|
||||
'system.multiclass': {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue