mirror of
https://github.com/RoY7x/worldbuilding.git
synced 2025-04-30 02:31:41 -04:00
Fix v10 bug for shorthand attributes (#52)
Co-authored-by: Kim Mantas <kim.mantas@gmail.com>
This commit is contained in:
parent
9e726433ea
commit
3343d3bf6c
1 changed files with 3 additions and 3 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Reference in a new issue