diff --git a/module/rdd-calendrier.js b/module/rdd-calendrier.js index ee248b73..878cc357 100644 --- a/module/rdd-calendrier.js +++ b/module/rdd-calendrier.js @@ -109,13 +109,13 @@ export class RdDCalendrier extends Application { /* -------------------------------------------- */ getCurrentNombreAstral() { let index = this.getCurrentDayIndex(); - let astralData = this.listeNombreAstral.find( (nombreAstral, i) => nombreAstral.index == index ); - return astralData.nombreAstral || "N/A"; + return this.getNombreAstral(index); } /* -------------------------------------------- */ getNombreAstral( index ) { - let astralData = this.listeNombreAstral.find( (nombreAstral, i) => nombreAstral.index == index ); + const liste = this.listeNombreAstral || game.settings.get("foundryvtt-reve-de-dragon", "liste-nombre-astral") + let astralData = liste.find( (nombreAstral, i) => nombreAstral.index == index ); return astralData.nombreAstral || "N/A"; }