v12.0.9 - Le scriptorium d'Astrobazzarh #711

Merged
uberwald merged 13 commits from VincentVk/foundryvtt-reve-de-dragon:v11 into v11 2024-09-27 10:16:54 +02:00
Showing only changes of commit 43607afc12 - Show all commits

View File

@ -65,9 +65,9 @@ export class RdDItemSort extends Item {
/* -------------------------------------------- */
static buildBonusCaseList(bonuscase, newCase) {
const list = RdDItemSort._bonuscaseStringToList(bonuscase)
const list = RdDItemSort.bonuscaseStringToList(bonuscase)
if (newCase) {
return list.concat({ case: "Nouvelle", bonus: 0 });
list.push({ case: "Nouvelle", bonus: 0 })
}
return list;
}
@ -138,8 +138,11 @@ export class RdDItemSort extends Item {
.sort(Misc.ascending())
.join(',');
}
static _bonuscaseStringToList(bonuscase) {
return (bonuscase ?? '').split(',').map(it => {
static bonuscaseStringToList(bonuscase) {
if (bonuscase == undefined || bonuscase == '') {
return []
}
return bonuscase.split(',').map(it => {
const b = it.split(':');
return { case: b[0], bonus: b[1] };
});