Skip to content

Commit

Permalink
Corrected roll formula simplification for display purposes. (foundryv…
Browse files Browse the repository at this point in the history
…tt#3944)

Co-authored-by: Kim Mantas <[email protected]>
  • Loading branch information
trioderegion and Fyorl authored Aug 6, 2024
1 parent ecc053a commit 28522e9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions module/dice/simplify-roll-formula.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ function _simplifyDiceTerms(terms) {
const modifiers = isCoin ? "" : curr.modifiers.filterJoin("");
const key = `${unannotated[i - 1].operator}${face}${modifiers}`;
obj[key] ??= {};
if ( (curr._number instanceof Roll) && (curr._number.isDeterministic) ) curr._number.evaluateSync();
obj[key].number = (obj[key].number ?? 0) + curr.number;
if ( !isCoin ) obj[key].modifiers = (obj[key].modifiers ?? []).concat(curr.modifiers);
return obj;
Expand Down

0 comments on commit 28522e9

Please sign in to comment.