From f2df126cfb9a3a1fbed9048c995236815f838210 Mon Sep 17 00:00:00 2001 From: WBHarry Date: Sat, 27 Dec 2025 14:40:03 +0100 Subject: [PATCH] . --- module/data/action/baseAction.mjs | 15 +++++++-------- module/documents/actor.mjs | 4 +++- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/module/data/action/baseAction.mjs b/module/data/action/baseAction.mjs index a9521b4a..6c7b8c59 100644 --- a/module/data/action/baseAction.mjs +++ b/module/data/action/baseAction.mjs @@ -164,14 +164,13 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel getRollData(data = {}) { const actorData = this.actor ? this.actor.getRollData(false) : {}; - return { - ...actorData, - result: data.roll?.total ?? 1, - scale: data.costs?.length // Right now only return the first scalable cost. - ? (data.costs.find(c => c.scalable)?.total ?? 1) - : 1, - roll: {} - }; + actorData.result = data.roll?.total ?? 1; + actorData.scale = data.costs?.length // Right now only return the first scalable cost. + ? (data.costs.find(c => c.scalable)?.total ?? 1) + : 1; + actorData.roll = {}; + + return actorData; } /** diff --git a/module/documents/actor.mjs b/module/documents/actor.mjs index d8e05e16..9f4db5e2 100644 --- a/module/documents/actor.mjs +++ b/module/documents/actor.mjs @@ -539,8 +539,10 @@ export default class DhpActor extends Actor { /**@inheritdoc */ getRollData() { + const rollData = foundry.utils.deepClone(super.getRollData()); /* system gets repeated infinately which causes issues when trying to use the data for document creation */ - const { system, ...rollData } = foundry.utils.deepClone(super.getRollData()); + delete rollData.system; + rollData.name = this.name; rollData.system = this.system.getRollData(); rollData.prof = this.system.proficiency ?? 1;