From f2d1879135741b50d42138fedcb41a8cfb1dad5f Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Thu, 27 Oct 2022 22:37:55 +0200 Subject: [PATCH] =?UTF-8?q?Fix:=20rollCarac=20pour=20odorat-go=C3=BBt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Recherche d'abord par clé (name) --- module/actor.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/module/actor.js b/module/actor.js index e2242499..76eb9ad6 100644 --- a/module/actor.js +++ b/module/actor.js @@ -3164,7 +3164,11 @@ export class RdDActor extends Actor { case 'chance-actuelle': case 'chance actuelle': return carac.chance; } - let entry = Misc.findFirstLike(name, Object.entries(carac), { mapper: it => it[1].label, description: 'caractéristique' }); + const caracList = Object.entries(carac); + let entry = Misc.findFirstLike(name, caracList, { mapper: it => it[0], description: 'caractéristique' }); + if (!entry || entry.length ==0) { + entry = Misc.findFirstLike(name, caracList, { mapper: it => it[1].label, description: 'caractéristique' }); + } return entry && entry.length > 0 ? carac[entry[0]] : undefined; }