Correction XP competence/sort/carac et chiffres astro
This commit is contained in:
committed by
Vincent Vandemeulebrouck
parent
7ddc50ab86
commit
7eada123c8
@ -187,20 +187,18 @@ export class RdDCalendrier extends Application {
|
||||
async rebuildListeNombreAstral() {
|
||||
if (game.user.isGM) {
|
||||
let jourCourant = this.getCurrentDayIndex();
|
||||
let jourFin = jourCourant + 12;
|
||||
|
||||
let newList = [];
|
||||
for (const na of this.listeNombreAstral) {
|
||||
let index = na?.index;
|
||||
if (index && index >= jourCourant && index < jourFin) {
|
||||
newList[index - jourCourant] = na;
|
||||
}
|
||||
}
|
||||
for (let i = 0; i < 12; i++) {
|
||||
if (newList[i] == undefined) {
|
||||
newList[i] = await this.ajouterNombreAstral(jourCourant + i);
|
||||
let dayIndex = jourCourant + i;
|
||||
let na = this.listeNombreAstral.find( n => n.index == dayIndex);
|
||||
if ( na ) {
|
||||
newList[i] = duplicate(na);
|
||||
} else {
|
||||
newList[i] = await this.ajouterNombreAstral(dayIndex);
|
||||
}
|
||||
}
|
||||
console.log("SAVE list", newList, jourCourant);
|
||||
this.listeNombreAstral = newList;
|
||||
game.settings.set("foundryvtt-reve-de-dragon", "liste-nombre-astral", this.listeNombreAstral);
|
||||
}
|
||||
|
Reference in New Issue
Block a user