From e41a936def2b1d488e814d09d391eb147bcb7fa3 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Fri, 7 May 2021 00:06:47 +0200 Subject: [PATCH] =?UTF-8?q?Fix=20quantit=C3=A9=20split=20item?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/actor-sheet.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/module/actor-sheet.js b/module/actor-sheet.js index 4b5b3512..2c3f843d 100644 --- a/module/actor-sheet.js +++ b/module/actor-sheet.js @@ -623,11 +623,10 @@ export class RdDActorSheet extends ActorSheet { } async _onSplitItem(item, split) { - const itemData = Misc.data(item); - if (split >= 1 && split < itemData.data.quantite) { + if (split >= 1 && split < Misc.data(item).data.quantite) { await item.diminuerQuantite(split); + const itemData = duplicate( Misc.data(item)); itemData.data.quantite = split; - itemData.id = undefined; await this.actor.createEmbeddedDocuments('Item', [itemData]) } }