diff --git a/module/actor-sheet.js b/module/actor-sheet.js index d87f3908..46fb7979 100644 --- a/module/actor-sheet.js +++ b/module/actor-sheet.js @@ -122,7 +122,7 @@ export class RdDActorSheet extends ActorSheet { data.data.potions = this._checkNull(data.itemsByType['potions']); data.data.ingredients = this._checkNull(data.itemsByType['ingredient']); data.data.munitions = this._checkNull(data.itemsByType['munition']); - data.data.herbes = this._checkNull(data.itemsByType['herbes']); + data.data.herbes = this._checkNull(data.itemsByType['herbe']); data.data.sorts = this._checkNull(data.itemsByType['sort']); data.data.queues = this._checkNull(data.itemsByType['queue']); data.data.souffles = this._checkNull(data.itemsByType['souffle']); @@ -158,7 +158,7 @@ export class RdDActorSheet extends ActorSheet { async displayDialogEncaisser( ) { let data = { bonusmalusTable: CONFIG.RDD.bonusmalus }; let html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-roll-encaisser.html', data ); - new RdDEncaisser(html, this.actor ).render(true);enleverDeConteneur + new RdDEncaisser(html, this.actor ).render(true); } /* -------------------------------------------- */ diff --git a/module/actor.js b/module/actor.js index 924e4ada..f368d559 100644 --- a/module/actor.js +++ b/module/actor.js @@ -343,10 +343,12 @@ export class RdDActor extends Actor { let conteneur = this.items.find( conteneur => conteneurId == conteneur._id); // recup conteneur if ( conteneur ) { // Si présent //console.log("Suppression du conteneur1", conteneurId, itemId, conteneur.data.data.contenu); - let newContenu = conteneur.data.data.contenu.filter( function(value, index, arr) { return value != itemId } ); + let contenu = conteneur.data.data.contenu; + contenu.splice(contenu.indexOf('itemId'), 1); + //let newContenu = conteneur.data.data.contenu.filter( function(value, index, arr) { return value != itemId } ); //console.log("Suppression du conteneur2", conteneurId, itemId, newContenu); - let update = {_id: conteneurId, "data.contenu": newContenu }; - await this.updateEmbeddedEntity("OwnedItem", update); + //let update = {_id: conteneurId, "data.contenu": newContenu }; + await this.updateEmbeddedEntity("OwnedItem", conteneur.data); } } diff --git a/system.json b/system.json index 958f5b69..c6ca0c9b 100644 --- a/system.json +++ b/system.json @@ -2,7 +2,7 @@ "name": "foundryvtt-reve-de-dragon", "title": "Rêve de Dragon", "description": "Rêve de Dragon RPG for FoundryVTT", - "version": "0.9.38", + "version": "0.9.39", "minimumCoreVersion": "0.7.5", "compatibleCoreVersion": "0.7.6", "templateVersion": 44,