forked from public/foundryvtt-reve-de-dragon
		
	Fix: achat de plusieurs conteneurs
Les conteneurs n'ont pas de quantité, du coup, en créer plusieurs en cas d'achat multiples
This commit is contained in:
		| @@ -3623,10 +3623,11 @@ export class RdDActor extends Actor { | |||||||
|         type: vente.item.type, |         type: vente.item.type, | ||||||
|         img: vente.item.img, |         img: vente.item.img, | ||||||
|         name: vente.item.name, |         name: vente.item.name, | ||||||
|         data: vente.item.data |         data: vente.item.data, | ||||||
|  |         quantite: "quantite" in vente.item ? achat.quantiteTotal : undefined | ||||||
|       } |       } | ||||||
|       achatData.data.quantite = achat.quantiteTotal; |       let listeAchat = ("quantite" in vente.item) ? [achatData] : Array.from({length: achat.quantiteTotal}, (_, i) => achatData) | ||||||
|       let items = await acheteur.createEmbeddedDocuments("Item", [achatData]); |       let items = await acheteur.createEmbeddedDocuments("Item", listeAchat) | ||||||
|       if (achat.choix.consommer && vente.item.type == 'nourritureboisson') { |       if (achat.choix.consommer && vente.item.type == 'nourritureboisson') { | ||||||
|         achat.choix.doses = achat.choix.nombreLots; |         achat.choix.doses = achat.choix.nombreLots; | ||||||
|         await acheteur.consommerNourritureboisson(items[0], achat.choix); |         await acheteur.consommerNourritureboisson(items[0], achat.choix); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user