Fix display bug with zero maxroll

This commit is contained in:
b 2021-09-05 22:45:01 -07:00
parent 3f77867416
commit d7ec1aafd6
2 changed files with 11 additions and 3 deletions

View file

@ -3,7 +3,7 @@ const url_tag = location.hash.slice(1);
// console.log(url_tag);
const BUILD_VERSION = "7.0.17";
const BUILD_VERSION = "7.0.18";
function setTitle() {
let text;

View file

@ -560,7 +560,13 @@ function displayExpandedItem(item, parent_id){
}
else {
let id = command;
if(( nonRolledIDs.includes(id) && item.get(id))){//nonRolledID & non-0/non-null/non-und ID
if(nonRolledIDs.includes(id)){//nonRolledID & non-0/non-null/non-und ID
if (!item.get(id)) {
if (! (item.get("crafted") && skp_order.includes(id) &&
(item.get("maxRolls").get(id) || item.get("minRolls").get(id)))) {
continue;
}
}
if (id === "slots") {
let p_elem = document.createElement("p");
// PROPER POWDER DISPLAYING
@ -717,7 +723,9 @@ function displayExpandedItem(item, parent_id){
}
}
}
else if ( rolledIDs.includes(id) && item.get("maxRolls") && item.get("maxRolls").get(id) ){ // && item.get("maxRolls").get(id) ){//rolled ID & non-0/non-null/non-und ID
else if ( rolledIDs.includes(id) &&
((item.get("maxRolls") && item.get("maxRolls").get(id))
|| (item.get("minRolls") && item.get("minRolls").get(id)))) {
let style = "positive";
if (item.get("minRolls").get(id) < 0) {
style = "negative";