Skip to content

Commit

Permalink
feat(d8roll): adjust the parts of formula to exclude null and zero va…
Browse files Browse the repository at this point in the history
…lues
  • Loading branch information
SouOWendel committed Oct 26, 2024
1 parent 995e198 commit ba863bf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion module/dice/dice.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ export async function d8Roll({
}={}) {

// Handle input arguments
const formula = ["2d8"].concat(parts).join(" + ");
let formula = ["2d8"];
parts = parts.filter((x) => (x !== null && x !== 0));
if (parts) formula = formula.concat(parts).join(" + ");

const defaultRollMode = rollMode || game.settings.get("core", "rollMode");

// Construct the D8Roll instance
Expand Down

0 comments on commit ba863bf

Please sign in to comment.