From a9d49d793c50e8cc2d581f15ba485882ca78f709 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Tue, 20 Apr 2021 00:49:01 +0200 Subject: [PATCH] Fix encTotal dans dialogues --- module/actor.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/module/actor.js b/module/actor.js index edbe258f..bbc03d88 100644 --- a/module/actor.js +++ b/module/actor.js @@ -167,7 +167,7 @@ export class RdDActor extends Actor { // Initialize empty items RdDCarac.computeCarac(actorData.data); this.computeIsHautRevant(); - this.computeEncombrementTotalEtMalusArmure(); + await this.computeEncombrementTotalEtMalusArmure(); this.computePrixTotalEquipement(); this.computeEtatGeneral(); // Sanity check @@ -1083,11 +1083,10 @@ export class RdDActor extends Actor { /* -------------------------------------------- */ computeEncombrement() { - const tplData = Misc.templateData(this); - tplData.encTotal = this.filterItemsData(it => it.data.encombrement != undefined) + this.encTotal = this.filterItemsData(it => it.data.encombrement != undefined) .map(it => it.data.encTotal) .reduce(Misc.sum(), 0); - return tplData.encTotal; + return this.encTotal; } /* -------------------------------------------- */ @@ -1104,12 +1103,11 @@ export class RdDActor extends Actor { /* -------------------------------------------- */ computePrixTotalEquipement() { - const tplData = Misc.templateData(this); - tplData.prixTotalEquipement = this.filterItemsData(it => it.data.prixTotal) + this.prixTotalEquipement = this.filterItemsData(it => it.data.prixTotal) .map(it => it.data.prixTotal ?? 0) .reduce(Misc.sum(), 0); // Mise à jour valeur totale de l'équipement - return tplData.prixTotalEquipement; + return this.prixTotalEquipement; } /* -------------------------------------------- */