Fix: trier les monnaies par valeur

This commit is contained in:
Vincent Vandemeulebrouck 2021-06-05 02:05:51 +02:00
parent 9a7b01a985
commit c7a417fc69
2 changed files with 7 additions and 2 deletions

View File

@ -26,7 +26,7 @@ const monnaiesData = [
export class Monnaie {
static isSystemMonnaie(item) {
let present = monnaiesData.find( monnaie => monnaie.data.valeur_deniers == item.data?.data?.valeur_deniers);
let present = monnaiesData.find(monnaie => monnaie.data.valeur_deniers == Misc.data(item)?.data?.valeur_deniers);
return present;
}
@ -54,4 +54,8 @@ export class Monnaie {
static arrondiDeniers(sols) {
return sols.toFixed(2);
}
static triValeurDenier() {
return Misc.ascending(item => Misc.data(item).data.valeur_deniers);
}
}

View File

@ -364,6 +364,7 @@ export class RdDUtility {
.concat(formData.nourritureboissons)
.concat(formData.monnaie);
formData.competences = (formData.itemsByType.competence ?? []).concat(formData.itemsByType.competencecreature ?? []);
formData.monnaie.sort(Monnaie.triValeurDenier());
}
/* -------------------------------------------- */