Fix expérience carac

=> await manquant
=> plusieurs whisper recipients: pas supporté
=> manque lowercase sur recherche de carac par nom
This commit is contained in:
Vincent Vandemeulebrouck 2021-03-27 14:39:40 +01:00
parent 1ea6b66483
commit dae852a1e0
2 changed files with 3 additions and 3 deletions

View File

@ -1688,11 +1688,11 @@ export class RdDActor extends Actor {
/* -------------------------------------------- */ /* -------------------------------------------- */
async _appliquerAjoutExperience(rollData, display = true) { async _appliquerAjoutExperience(rollData, display = true) {
if (!this.isPersonnage()) return; 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) { if (display && xpResult.result) {
let xpmsg = "<br>Points d'expérience gagnés ! Carac: " + xpResult.xpCarac + ", Comp: " + xpResult.xpCompetence; let xpmsg = "<br>Points d'expérience gagnés ! Carac: " + xpResult.xpCarac + ", Comp: " + xpResult.xpCompetence;
let message = { let message = {
whisher: ChatMessage.getWhisperRecipients(["GM", this.name]), whisher: ChatUtility.getWhisperRecipientsAndGMs(this.name),
content: "<strong>" + rollData.selectedCarac.label + "</strong>" + xpmsg, content: "<strong>" + rollData.selectedCarac.label + "</strong>" + xpmsg,
} }
ChatMessage.create(message); ChatMessage.create(message);

View File

@ -40,7 +40,7 @@ export class RdDCarac {
/* -------------------------------------------- */ /* -------------------------------------------- */
static findCarac(carac, name) { static findCarac(carac, name) {
name = Grammar.toLowerCaseNoAccent(name);
const pairs = Object.entries(carac) const pairs = Object.entries(carac)
.filter(([key, value]) => key.includes(name) || Grammar.toLowerCaseNoAccent(value.label).includes(name)); .filter(([key, value]) => key.includes(name) || Grammar.toLowerCaseNoAccent(value.label).includes(name));