Patch for zero value ids

idRound does not round to zero in some cases
This commit is contained in:
hppeng 2022-01-05 12:39:42 -08:00
parent de4888fa66
commit ac87cf5112

View file

@ -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) {