Bugfixes #565
@ -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());
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user