Minor fixes
This commit is contained in:
parent
3a8a8fa5fb
commit
99f67565cc
@ -198,7 +198,7 @@ export class RdDActor extends Actor {
|
|||||||
async checkMonnaiePresence(items) { // Ajout opportuniste si les pièces n'existent pas.
|
async checkMonnaiePresence(items) { // Ajout opportuniste si les pièces n'existent pas.
|
||||||
if (!items) return; // Sanity check during import
|
if (!items) return; // Sanity check during import
|
||||||
let manquantes = Monnaie.monnaiesManquantes(items);
|
let manquantes = Monnaie.monnaiesManquantes(items);
|
||||||
console.log("Manque : ", manquantes);
|
//console.log("Manque : ", manquantes);
|
||||||
if (manquantes.length > 0) {
|
if (manquantes.length > 0) {
|
||||||
await this.createEmbeddedDocuments('Item', manquantes, { renderSheet: false });
|
await this.createEmbeddedDocuments('Item', manquantes, { renderSheet: false });
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ export class Monnaie {
|
|||||||
|
|
||||||
static isSystemMonnaie(item) {
|
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 == item.data?.data?.valeur_deniers);
|
||||||
return present;
|
return present != undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
static monnaiesData() {
|
static monnaiesData() {
|
||||||
@ -39,12 +39,9 @@ export class Monnaie {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static monnaiesManquantes(items) {
|
static monnaiesManquantes(items) {
|
||||||
const valeurs = Monnaie.filtrerMonnaies(items)
|
const valeursPresentes = Monnaie.filtrerMonnaies(items)
|
||||||
.map(it => Misc.templateData(it).valeur_deniers);
|
.map(it => Misc.templateData(it).valeur_deniers)
|
||||||
const manquantes = monnaiesData.filter(monnaie => !valeurs.find(v => v != Misc.templateData(monnaie).valeur_deniers));
|
return monnaiesData.filter(monnaie => !valeursPresentes.includes(Misc.templateData(monnaie).valeur_deniers) );
|
||||||
//const manquantes = monnaiesData.filter(monnaie => !valeurs.find(v => v != Misc.templateData(monnaie).valeur_deniers) );
|
|
||||||
console.log("Valeurs : ", valeurs, manquantes);
|
|
||||||
return []; //manquantes;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static deValeur(monnaie, v) {
|
static deValeur(monnaie, v) {
|
||||||
|
@ -342,7 +342,7 @@ export class RdDUtility {
|
|||||||
formData.ombres = this.checkNull(formData.itemsByType['ombre']);
|
formData.ombres = this.checkNull(formData.itemsByType['ombre']);
|
||||||
formData.tetes = this.checkNull(formData.itemsByType['tete']);
|
formData.tetes = this.checkNull(formData.itemsByType['tete']);
|
||||||
formData.taches = this.checkNull(formData.itemsByType['tache']);
|
formData.taches = this.checkNull(formData.itemsByType['tache']);
|
||||||
formData.monnaie = this.checkNull(formData.itemsByType['monnaie']);
|
formData.monnaie = this.checkNull(formData.itemsByType['monnaie']);
|
||||||
formData.nourritureboissons = this.checkNull(formData.itemsByType['nourritureboisson']);
|
formData.nourritureboissons = this.checkNull(formData.itemsByType['nourritureboisson']);
|
||||||
formData.meditations = this.checkNull(formData.itemsByType['meditation']);
|
formData.meditations = this.checkNull(formData.itemsByType['meditation']);
|
||||||
formData.chants = this.checkNull(formData.itemsByType['chant']);
|
formData.chants = this.checkNull(formData.itemsByType['chant']);
|
||||||
|
Loading…
Reference in New Issue
Block a user