Fix: vente depuis un commerce

La quantité proposée est limitée à la quantité disponible
ou illimité si le commerce est illimité
This commit is contained in:
2023-01-03 23:46:08 +01:00
parent 39d14c8496
commit 8e0825b6b9
3 changed files with 18 additions and 11 deletions

View File

@ -259,8 +259,12 @@ export class RdDItem extends Item {
return this.system.cout ?? 0
}
isItemCommerce() {
return this.parent?.type == 'commerce';
}
calculerPrixCommercant() {
if (this.parent?.type == 'commerce') {
if (this.isItemCommerce()) {
// appliquer le pourcentage
return this.parent.calculerPrix(this);
}