From 921e470498bcc916e3fca40f5b1ad872f197de5c Mon Sep 17 00:00:00 2001 From: LeRatierBretonnien Date: Thu, 27 Feb 2025 22:53:06 +0100 Subject: [PATCH] Petit fixes de synchro + essai pour corriger message XP + roll --- module/actor.js | 9 +++++++-- module/misc.js | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/module/actor.js b/module/actor.js index e4cc209c..65d50a2f 100644 --- a/module/actor.js +++ b/module/actor.js @@ -557,7 +557,10 @@ export class RdDActor extends RdDBaseActorSang { return; } fatigue = Math.max(fatigueMin, this._calculRecuperationSegment(fatigue)); - await this.update({ "system.sante.fatigue.value": fatigue }); + setTimeout( // On attend un peu pour que le message de récupération de r + async () => { + await this.update({ 'system.sante.fatigue.value': fatigue }); + }, 200); if (fatigue == 0) { message.content += "Vous êtes complêtement reposé. "; } @@ -1800,8 +1803,10 @@ export class RdDActor extends RdDBaseActorSang { }; RollDataAjustements.calcul(rollData, this); await RdDResolutionTable.rollData(rollData); - this.gererExperience(rollData); await RdDRollResult.displayRollData(rollData, this) + + this.gererExperience(rollData); + return rollData.rolled; } diff --git a/module/misc.js b/module/misc.js index 775dd2bc..ebecc08d 100644 --- a/module/misc.js +++ b/module/misc.js @@ -265,7 +265,7 @@ export class Misc { const subset = elements.filter(options.preFilter) .filter(it => Grammar.toLowerCaseNoAccent(options.mapper(it))?.includes(value)) .sort(Misc.ascending(it => options.mapper(it))) - if (subset.length == 0) { + if (subset.length == 0 && options?.onMessage) { options.onMessage(`Pas de ${options.description} correspondant à ${value}`); } return subset;