Fix: tirage dans une table ne fonctionnait plus

Régression bête, qui empêchait aussi d'afficher le résultat d'un échec
contre un rêve de dragon
This commit is contained in:
Vincent Vandemeulebrouck 2022-10-14 00:48:05 +02:00
parent 21ec043e98
commit 168127d8fe

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());
} }