Bugfixes #565

Merged
uberwald merged 7 commits from VincentVk/foundryvtt-reve-de-dragon:v10 into v10 2022-10-14 22:52:09 +02:00
Showing only changes of commit 168127d8fe - Show all commits

View File

@ -2,14 +2,14 @@ export class RdDRollTables {
/* -------------------------------------------- */ /* -------------------------------------------- */
static async genericGetTableResult(tableName, toChat) { 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"}); const draw = await table.draw({ displayChat: toChat, rollMode: "gmroll"});
//console.log("RdDRollTables", tableName, toChat, ":", draw); //console.log("RdDRollTables", tableName, toChat, ":", draw);
return draw.results.length > 0 ? draw.results[0] : undefined; return draw.results.length > 0 ? draw.results[0] : undefined;
} }
static getWorldTable() { static getWorldTable(tableName) {
return game.tables.find(table => table.name.toLowerCase() == tableName.toLowerCase()); return game.tables.find(table => table.name.toLowerCase() == tableName.toLowerCase());
} }