mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-18 07:59:03 +01:00
Changed ItemLinksField makeup
This commit is contained in:
parent
600c08cb23
commit
30f31e77dd
13 changed files with 120 additions and 96 deletions
|
|
@ -171,18 +171,18 @@ export default class BaseDataItem extends foundry.abstract.TypeDataModel {
|
|||
);
|
||||
}
|
||||
|
||||
if (this.metadata.isItemLinkable) {
|
||||
const linkEntries = Object.entries(this.itemLinks);
|
||||
for (let [uuid, type] of linkEntries) {
|
||||
const item = await foundry.utils.fromUuid(uuid);
|
||||
const path = CONFIG.DH.ITEM.itemLinkFeatureTypes[type] ? 'system.features' : 'system.linkedItems';
|
||||
await item.update({
|
||||
[path]: foundry.utils
|
||||
.getProperty(item, path)
|
||||
.filter(x => x.uuid !== this.parent.uuid)
|
||||
.map(x => x.uuid)
|
||||
});
|
||||
}
|
||||
}
|
||||
// if (this.metadata.isItemLinkable) {
|
||||
// const linkEntries = Object.entries(this.itemLinks);
|
||||
// for (let [uuid, type] of linkEntries) {
|
||||
// const item = await foundry.utils.fromUuid(uuid);
|
||||
// const path = CONFIG.DH.ITEM.itemLinkFeatureTypes[type] ? 'system.features' : 'system.linkedItems';
|
||||
// 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