From 3343d3bf6c43584832f24372e9d85da5b350edca Mon Sep 17 00:00:00 2001 From: Matt Smith Date: Thu, 20 Oct 2022 10:39:10 -0500 Subject: [PATCH] Fix v10 bug for shorthand attributes (#52) Co-authored-by: Kim Mantas --- module/actor.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/module/actor.js b/module/actor.js index ffc968f..0823b8d 100644 --- a/module/actor.js +++ b/module/actor.js @@ -39,7 +39,7 @@ export class SimpleActor extends Actor { getRollData() { // Copy the actor's system data - const data = this.toObject(false); + const data = this.toObject(false).system; const shorthand = game.settings.get("worldbuilding", "macroShorthand"); const formulaAttributes = []; const itemAttributes = []; @@ -111,10 +111,10 @@ export class SimpleActor extends Actor { // Map all items data using their slugified names data.items = this.items.reduce((obj, item) => { const key = item.name.slugify({strict: true}); - const itemData = item.toObject(false); + const itemData = item.toObject(false).system; // Add items to shorthand and note which ones are formula attributes. - for ( let [k, v] of Object.entries(itemData.system.attributes) ) { + for ( let [k, v] of Object.entries(itemData.attributes) ) { // When building the attribute list, prepend the item name for later use. if ( v.dtype === "Formula" ) itemAttributes.push(`${key}..${k}`); // Add shortened version of the attributes.