mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-18 07:59:03 +01:00
Fixed removal of features/items propagating
This commit is contained in:
parent
30f31e77dd
commit
6a7f19363d
2 changed files with 21 additions and 15 deletions
|
|
@ -1318,8 +1318,7 @@ export const itemLinkFeatureTypes = {
|
||||||
class: 'class',
|
class: 'class',
|
||||||
foundation: 'foundation',
|
foundation: 'foundation',
|
||||||
specialization: 'specialization',
|
specialization: 'specialization',
|
||||||
mastery: 'mastery',
|
mastery: 'mastery'
|
||||||
subclass: 'subclass'
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const itemLinkItemTypes = {
|
export const itemLinkItemTypes = {
|
||||||
|
|
@ -1332,6 +1331,7 @@ export const itemLinkItemTypes = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const itemLinkTypes = {
|
export const itemLinkTypes = {
|
||||||
|
subclass: 'subclass',
|
||||||
...itemLinkFeatureTypes,
|
...itemLinkFeatureTypes,
|
||||||
...itemLinkItemTypes
|
...itemLinkItemTypes
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -171,18 +171,24 @@ export default class BaseDataItem extends foundry.abstract.TypeDataModel {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (this.metadata.isItemLinkable) {
|
if (this.metadata.isItemLinkable) {
|
||||||
// const linkEntries = Object.entries(this.itemLinks);
|
const linkEntries = Object.entries(this.itemLinks);
|
||||||
// for (let [uuid, type] of linkEntries) {
|
for (let [type, uuidList] of linkEntries) {
|
||||||
// const item = await foundry.utils.fromUuid(uuid);
|
for (let uuid of uuidList) {
|
||||||
// const path = CONFIG.DH.ITEM.itemLinkFeatureTypes[type] ? 'system.features' : 'system.linkedItems';
|
const item = await foundry.utils.fromUuid(uuid);
|
||||||
// await item.update({
|
const path = CONFIG.DH.ITEM.itemLinkFeatureTypes[type]
|
||||||
// [path]: foundry.utils
|
? 'system.features'
|
||||||
// .getProperty(item, path)
|
: CONFIG.DH.ITEM.itemLinkItemTypes[type]
|
||||||
// .filter(x => x.uuid !== this.parent.uuid)
|
? 'system.linkedItems'
|
||||||
// .map(x => x.uuid)
|
: 'system.subclasses';
|
||||||
// });
|
await item.update({
|
||||||
// }
|
[path]: foundry.utils
|
||||||
// }
|
.getProperty(item, path)
|
||||||
|
.filter(x => x.uuid !== this.parent.uuid)
|
||||||
|
.map(x => x.uuid)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue