From ac87cf5112bd28e06325e67bb096d949186b93b9 Mon Sep 17 00:00:00 2001 From: hppeng Date: Wed, 5 Jan 2022 12:39:42 -0800 Subject: [PATCH] Patch for zero value ids idRound does not round to zero in some cases --- js/display.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/js/display.js b/js/display.js index 7be7bc3..b00ae25 100644 --- a/js/display.js +++ b/js/display.js @@ -52,7 +52,7 @@ function expandItem(item, powders) { maxRolls.set(id,idRound(val*1.3)); minRolls.set(id,idRound(val*0.3)); } - } else if (val <= 0) { //negative rolled IDs + } else if (val < 0) { //negative rolled IDs if (reversedIDs.includes(id)) { maxRolls.set(id,idRound(val*1.3)); minRolls.set(id,idRound(val*0.7)); @@ -62,6 +62,11 @@ function expandItem(item, powders) { minRolls.set(id,idRound(val*1.3)); } } + else { // if val == 0 + // NOTE: DO NOT remove this case! idRound behavior does not round to 0! + maxRolls.set(id,0); + minRolls.set(id,0); + } } } for (const id of nonRolledIDs) {