From f388d6550c5808618d8bfc844ae74ca5f5e8fe4d Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Thu, 27 Oct 2022 22:37:20 +0200 Subject: [PATCH] Fix: recherche carac plus lisible --- module/actor.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/module/actor.js b/module/actor.js index fa1860ad..0364d399 100644 --- a/module/actor.js +++ b/module/actor.js @@ -3143,9 +3143,10 @@ export class RdDActor extends Actor { return carac.chance; } - let entry = Misc.findFirstLike(name, Object.entries(carac), { mapper: it => it[0], 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, Object.entries(carac), { mapper: it => it[1].label, description: 'caractéristique' }); + entry = Misc.findFirstLike(name, caracList, { mapper: it => it[1].label, description: 'caractéristique' }); } return entry && entry.length > 0 ? carac[entry[0]] : undefined; }