mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-06-06 04:44:16 +02:00
Allow apply to item system data
This commit is contained in:
parent
23b0f68954
commit
3d73a08ee0
2 changed files with 2 additions and 8 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue