From dae852a1e02142706a24bb4ac3a4a30b7a34514d Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Sat, 27 Mar 2021 14:39:40 +0100 Subject: [PATCH 1/2] =?UTF-8?q?Fix=20exp=C3=A9rience=20carac?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit => await manquant => plusieurs whisper recipients: pas supporté => manque lowercase sur recherche de carac par nom --- module/actor.js | 4 ++-- module/rdd-carac.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/module/actor.js b/module/actor.js index 02534de7..9083fb9f 100644 --- a/module/actor.js +++ b/module/actor.js @@ -1688,11 +1688,11 @@ export class RdDActor extends Actor { /* -------------------------------------------- */ async _appliquerAjoutExperience(rollData, display = true) { if (!this.isPersonnage()) return; - let xpResult = this.appliquerExperience(rollData.rolled, rollData.selectedCarac.label, rollData.competence); + let xpResult = await this.appliquerExperience(rollData.rolled, rollData.selectedCarac.label, rollData.competence); if (display && xpResult.result) { let xpmsg = "
Points d'expérience gagnés ! Carac: " + xpResult.xpCarac + ", Comp: " + xpResult.xpCompetence; let message = { - whisher: ChatMessage.getWhisperRecipients(["GM", this.name]), + whisher: ChatUtility.getWhisperRecipientsAndGMs(this.name), content: "" + rollData.selectedCarac.label + "" + xpmsg, } ChatMessage.create(message); diff --git a/module/rdd-carac.js b/module/rdd-carac.js index 77d41ff4..368a8005 100644 --- a/module/rdd-carac.js +++ b/module/rdd-carac.js @@ -40,7 +40,7 @@ export class RdDCarac { /* -------------------------------------------- */ static findCarac(carac, name) { - + name = Grammar.toLowerCaseNoAccent(name); const pairs = Object.entries(carac) .filter(([key, value]) => key.includes(name) || Grammar.toLowerCaseNoAccent(value.label).includes(name)); From d5277137dd988a897f12b35df3dc442d2f073b34 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Sat, 27 Mar 2021 14:40:06 +0100 Subject: [PATCH 2/2] =?UTF-8?q?Fix=20d=C3=A9pense=20chance=20sur=20appel?= =?UTF-8?q?=20=C3=A0=20la=20chance?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/actor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/actor.js b/module/actor.js index 9083fb9f..8817b883 100644 --- a/module/actor.js +++ b/module/actor.js @@ -2282,7 +2282,7 @@ export class RdDActor extends Actor { async chanceActuelleIncDec(value, limit = true) { let chance = Math.max(Misc.templateData(this).compteurs.chance.value + value, 0); if (limit) { - chance = Math.min(chance.value, this.getChance()) + chance = Math.min(chance, this.getChance()) } await this.updateCompteurValue("chance", chance); }