Fixed using ItemLinkfield for Ancestry/Class/Subclass

This commit is contained in:
WBHarry 2025-07-22 01:39:51 +02:00
parent 060fe41730
commit 6336f2a60f
11 changed files with 70 additions and 113 deletions

View file

@ -29,15 +29,21 @@ export default class DHSubclass extends BaseDataItem {
}
get foundationFeatures() {
return this.features.filter(x => x.system.subType === CONFIG.DH.ITEM.featureSubTypes.foundation);
return this.features.filter(
x => x.system.itemLinks[this.parent.uuid] === CONFIG.DH.ITEM.featureSubTypes.foundation
);
}
get specializationFeatures() {
return this.features.filter(x => x.system.subType === CONFIG.DH.ITEM.featureSubTypes.specialization);
return this.features.filter(
x => x.system.itemLinks[this.parent.uuid] === CONFIG.DH.ITEM.featureSubTypes.specialization
);
}
get masteryFeatures() {
return this.features.filter(x => x.system.subType === CONFIG.DH.ITEM.featureSubTypes.mastery);
return this.features.filter(
x => x.system.itemLinks[this.parent.uuid] === CONFIG.DH.ITEM.featureSubTypes.mastery
);
}
async _preCreate(data, options, user) {