Adaptation Feuilles Acteurs
This commit is contained in:
@ -5,7 +5,7 @@ export class RdDRollTables {
|
||||
const pack = game.packs.get("foundryvtt-reve-de-dragon.tables-diverses");
|
||||
const index = await pack.getIndex();
|
||||
const entry = index.find(e => e.name === tableName);
|
||||
const table = await pack.getEntity(entry._id);
|
||||
const table = await pack.getDocument(entry._id);
|
||||
const draw = await table.draw({ displayChat: toChat, rollMode: "gmroll"});
|
||||
console.log("RdDRollTables", tableName, toChat, ":", draw);
|
||||
return draw;
|
||||
@ -17,7 +17,7 @@ export class RdDRollTables {
|
||||
const drawnItemRef = draw.results.length > 0 ? draw.results[0] : undefined;
|
||||
if (drawnItemRef.collection) {
|
||||
const pack = game.packs.get(drawnItemRef.collection);
|
||||
return await pack.getEntity(drawnItemRef.resultId);
|
||||
return await pack.getDocument(drawnItemRef.resultId);
|
||||
}
|
||||
ui.notifications.warn("le tirage ne correspond pas à une entrée d'un Compendium")
|
||||
return drawnItemRef.text;
|
||||
@ -29,7 +29,7 @@ export class RdDRollTables {
|
||||
const drawnItemRef = draw.results.length > 0 ? draw.results[0] : undefined;
|
||||
if (drawnItemRef.collection) {
|
||||
ui.notifications.warn("le tirage correspond à une entrée d'un Compendium, on attendait un texte")
|
||||
return await pack.getEntity(drawnItemRef.resultId);
|
||||
return await pack.getDocument(drawnItemRef.resultId);
|
||||
}
|
||||
return drawnItemRef.text;
|
||||
}
|
||||
|
Reference in New Issue
Block a user