From fda822314f2600132142ddcc8076f3898f02db0a Mon Sep 17 00:00:00 2001 From: sladecraven Date: Mon, 21 Dec 2020 15:26:05 +0100 Subject: [PATCH] =?UTF-8?q?Fix=20quantite=20=C3=A0=200?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/actor.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/actor.js b/module/actor.js index 1437c522..1d1adfa3 100644 --- a/module/actor.js +++ b/module/actor.js @@ -642,7 +642,8 @@ export class RdDActor extends Actor { // Calcul encombrement if ( item.data && item.data.encombrement != undefined ) { if ( !Number(item.data.encombrement) ) item.data.encombrement = 0; // Auto-fix - if (!item.data.quantite) item.data.quantite = 1; // Auto-fix + if ( item.data.quantite == undefined) item.data.quantite = 1; // Auto-fix + if ( item.data.quantite < 0) item.data.quantite = 0; // Auto-fix item.data.encTotal = Number(item.data.encombrement) * Number(item.data.quantite); //console.log("Enc:", item.name, item.data.encombrement, item.data.quantite, item.data.encTotal); encTotal += item.data.encTotal;