diff --git a/module/actor.js b/module/actor.js index dd0ed7f9..8724a3f8 100644 --- a/module/actor.js +++ b/module/actor.js @@ -673,7 +673,11 @@ export class RdDActor extends Actor { let data2use = duplicate(conteneur.data); //console.log("Suppression du conteneur1", conteneurId, itemId, conteneur.data.data.contenu); let contenu = data2use.data.contenu; - contenu.splice(contenu.indexOf('itemId'), 1); + let index = contenu.indexOf(itemId); + while (index >= 0) { // Force cleanup, itemId is unique + contenu.splice(index, 1); + index = contenu.indexOf(itemId); + } //console.log("REMOVED: ", itemId, contenu ); //let newContenu = conteneur.data.data.contenu.filter( function(value, index, arr) { return value != itemId } ); //console.log("Suppression du conteneur2", conteneurId, itemId, newContenu);