Merge pull request 'Fix: rollCarac pour odorat-goût' (#569) from VincentVk/foundryvtt-reve-de-dragon:v1.5 into v1.5

Reviewed-on: #569
This commit is contained in:
uberwald 2022-10-28 08:45:31 +02:00
commit d57cdc2af4

View File

@ -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;
}