Various fixes for TMR, WIP

This commit is contained in:
2021-03-28 22:37:04 +02:00
parent f043c3b504
commit 36df301144
7 changed files with 15 additions and 13 deletions

View File

@ -15,9 +15,10 @@ export class RdDRollTables {
static async drawItemFromRollTable(tableName, toChat) {
const draw = await RdDRollTables.genericGetTableResult(tableName, toChat);
const drawnItemRef = draw.results.length > 0 ? draw.results[0] : undefined;
if (drawnItemRef.collection) {
const pack = game.packs.get(drawnItemRef.collection);
return await pack.getDocument(drawnItemRef.resultId);
if (drawnItemRef.data.collection) {
console.log(drawnItemRef);
const pack = game.packs.get(drawnItemRef.data.collection);
return await pack.getDocument(drawnItemRef.data.resultId);
}
ui.notifications.warn("le tirage ne correspond pas à une entrée d'un Compendium")
return drawnItemRef.text;