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 = {}) { getRollData(options = {}) {
const data = this.actor?.getRollData() ?? {}; const data = this.actor?.getRollData() ?? {};
data.item = this; data.item = shallowCopyWithGetters(this);
return data; return data;
} }

View file

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