Skip to content

Commit

Permalink
[#3895] Fix error thrown when simplifying certain roll expressions.
Browse files Browse the repository at this point in the history
  • Loading branch information
Fyorl committed Aug 30, 2024
1 parent b0ef575 commit 4634d08
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion module/dice/simplify-roll-formula.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export default function simplifyRollFormula(formula, { preserveFlavor=false, det
// If the formula contains multiplication or division we cannot easily simplify
if ( /[*/]/.test(roll.formula) ) {
if ( roll.isDeterministic && !/d\(/.test(roll.formula) && (!/\[/.test(roll.formula) || !preserveFlavor) ) {
return String(roll.evaluateSync().total);
return String(new Roll(roll.formula).evaluateSync().total);
}
else return roll.constructor.getFormula(roll.terms);
}
Expand Down

0 comments on commit 4634d08

Please sign in to comment.