diff --git a/module/rdd-rolltables.js b/module/rdd-rolltables.js index 3f90a5bd..9ba058c5 100644 --- a/module/rdd-rolltables.js +++ b/module/rdd-rolltables.js @@ -2,14 +2,14 @@ export class RdDRollTables { /* -------------------------------------------- */ static async genericGetTableResult(tableName, toChat) { - let table = RdDRollTables.getWorldTable() ?? (await RdDRollTables.getSystemTable(tableName)); + let table = RdDRollTables.getWorldTable(tableName) ?? (await RdDRollTables.getSystemTable(tableName)); const draw = await table.draw({ displayChat: toChat, rollMode: "gmroll"}); //console.log("RdDRollTables", tableName, toChat, ":", draw); return draw.results.length > 0 ? draw.results[0] : undefined; } - static getWorldTable() { + static getWorldTable(tableName) { return game.tables.find(table => table.name.toLowerCase() == tableName.toLowerCase()); }