Preventing getRollData from returning infinite recursion on the system property

This commit is contained in:
nsalyzyn 2025-12-17 17:06:51 -07:00
parent e74ce7726a
commit 5c1aff0245
2 changed files with 2 additions and 2 deletions

View file

@ -102,7 +102,7 @@ export default class BaseDataActor extends foundry.abstract.TypeDataModel {
* @returns {object} * @returns {object}
*/ */
getRollData() { getRollData() {
const data = { ...this }; const data = { ...this, system: { ...this.system, system: {} } };
return data; return data;
} }

View file

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