Gestion des signes draconiques #455

Closed
vincent.vandeme wants to merge 233 commits from v1.4-signes-draconiques into master
Showing only changes of commit e41a936def - Show all commits

View File

@ -623,11 +623,10 @@ export class RdDActorSheet extends ActorSheet {
} }
async _onSplitItem(item, split) { async _onSplitItem(item, split) {
const itemData = Misc.data(item); if (split >= 1 && split < Misc.data(item).data.quantite) {
if (split >= 1 && split < itemData.data.quantite) {
await item.diminuerQuantite(split); await item.diminuerQuantite(split);
const itemData = duplicate( Misc.data(item));
itemData.data.quantite = split; itemData.data.quantite = split;
itemData.id = undefined;
await this.actor.createEmbeddedDocuments('Item', [itemData]) await this.actor.createEmbeddedDocuments('Item', [itemData])
} }
} }