Allow apply to item system data

This commit is contained in:
Carlos Fernandez 2026-04-25 17:24:09 -04:00
parent 23b0f68954
commit 3d73a08ee0
2 changed files with 2 additions and 8 deletions

View file

@ -165,7 +165,7 @@ export default class BaseDataItem extends foundry.abstract.TypeDataModel {
*/
getRollData(options = {}) {
const data = this.actor?.getRollData() ?? {};
data.item = this;
data.item = shallowCopyWithGetters(this);
return data;
}

View file

@ -54,13 +54,7 @@ export default class DHItem extends foundry.documents.Item {
* @returns
*/
getRollData(options = {}) {
let data;
if (this.system.getRollData) data = this.system.getRollData(options);
else {
const actorRollData = this.actor?.getRollData(options) ?? {};
data = { ...actorRollData, item: { ...this.system } };
}
let data = this.system.getRollData(options);
if (data?.item) {
data.item.flags = { ...this.flags };
data.item.name = this.name;