Working on 0.8.x - Character sheets related

This commit is contained in:
Vlyan
2021-04-24 17:16:52 +02:00
parent 80907c8a01
commit b6f3d42fa2
61 changed files with 1569 additions and 470 deletions

View File

@@ -82,6 +82,8 @@ export class TwentyQuestions {
shuji: false,
maho: false,
ninjutsu: false,
link: false,
specificity: false,
},
techniques: [],
school_ability: [],
@@ -285,8 +287,8 @@ export class TwentyQuestions {
});
// Clear and add items to actor
const deleteIds = actor.data.items.map((e) => e._id);
await actor.deleteEmbeddedEntity("OwnedItem", deleteIds);
const deleteIds = actor.data.items.map((e) => e.id);
await actor.deleteEmbeddedDocuments("Item", deleteIds);
// Add items in 20Q to actor
for (const types of Object.values(itemsCache)) {
@@ -298,7 +300,7 @@ export class TwentyQuestions {
if (itemData.data?.xp_spent) {
itemData.data.xp_spent = 0;
}
await actor.createEmbeddedEntity("OwnedItem", itemData);
await actor.createEmbeddedDocuments("Item", [itemData]);
}
}