From aeb27e116a2a5cebc483e796e3a41e887ffd9ba8 Mon Sep 17 00:00:00 2001 From: sladecraven Date: Sat, 28 Nov 2020 10:05:53 +0100 Subject: [PATCH] Modif sur gestion equipement --- module/actor.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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);