forked from public/foundryvtt-reve-de-dragon
Compendiums paramétrables
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
import { SystemCompendiums } from "./settings/system-compendiums.js";
|
||||
|
||||
export class RdDRollTables {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -14,7 +16,7 @@ export class RdDRollTables {
|
||||
}
|
||||
|
||||
static async getSystemTable(tableName) {
|
||||
const pack = game.packs.get("foundryvtt-reve-de-dragon.tables-diverses");
|
||||
const pack = SystemCompendiums.getPack("tables-diverses");
|
||||
const index = await pack.getIndex();
|
||||
const entry = index.find(e => e.name === tableName);
|
||||
return await pack.getDocument(entry._id);
|
||||
@ -24,8 +26,7 @@ export class RdDRollTables {
|
||||
static async drawItemFromRollTable(tableName, toChat = false) {
|
||||
const drawResult = await RdDRollTables.genericGetTableResult(tableName, toChat);
|
||||
const pack = game.packs.get(drawResult.documentCollection)
|
||||
let doc = await pack.getDocument(drawResult.documentId)
|
||||
return doc
|
||||
return await pack.getDocument(drawResult.documentId)
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
Reference in New Issue
Block a user