mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-18 07:59:03 +01:00
Fixed so that features are deleted from system.features if if the feature itself is deleted
This commit is contained in:
parent
867947c2c5
commit
28efef7951
10 changed files with 241 additions and 179 deletions
|
|
@ -68,7 +68,13 @@ export default class SubclassSheet extends DHBaseItemSheet {
|
|||
return;
|
||||
}
|
||||
|
||||
await item.update({ 'system.subType': CONFIG.DH.ITEM.featureSubTypes.foundation });
|
||||
await item.update({
|
||||
system: {
|
||||
subType: CONFIG.DH.ITEM.featureSubTypes.foundation,
|
||||
originItemType: CONFIG.DH.ITEM.featureTypes[this.document.type].id,
|
||||
originId: this.document.uuid
|
||||
}
|
||||
});
|
||||
await this.document.update({
|
||||
'system.features': [...this.document.system.features.map(x => x.uuid), item.uuid]
|
||||
});
|
||||
|
|
@ -78,7 +84,13 @@ export default class SubclassSheet extends DHBaseItemSheet {
|
|||
return;
|
||||
}
|
||||
|
||||
await item.update({ 'system.subType': CONFIG.DH.ITEM.featureSubTypes.specialization });
|
||||
await item.update({
|
||||
system: {
|
||||
subType: CONFIG.DH.ITEM.featureSubTypes.specialization,
|
||||
originItemType: CONFIG.DH.ITEM.featureTypes[this.document.type].id,
|
||||
originId: this.document.uuid
|
||||
}
|
||||
});
|
||||
await this.document.update({
|
||||
'system.features': [...this.document.system.features.map(x => x.uuid), item.uuid]
|
||||
});
|
||||
|
|
@ -88,7 +100,13 @@ export default class SubclassSheet extends DHBaseItemSheet {
|
|||
return;
|
||||
}
|
||||
|
||||
await item.update({ 'system.subType': CONFIG.DH.ITEM.featureSubTypes.mastery });
|
||||
await item.update({
|
||||
system: {
|
||||
subType: CONFIG.DH.ITEM.featureSubTypes.mastery,
|
||||
originItemType: CONFIG.DH.ITEM.featureTypes[this.document.type].id,
|
||||
originId: this.document.uuid
|
||||
}
|
||||
});
|
||||
await this.document.update({
|
||||
'system.features': [...this.document.system.features.map(x => x.uuid), item.uuid]
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue