Fix quantité split item
This commit is contained in:
parent
6b96f73b7a
commit
e41a936def
@ -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])
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user