Add loopCountCheck to maximizeRoll reroll shortcut

This commit is contained in:
Ean Milligan 2025-04-27 04:58:54 -04:00
parent 2f2a8f67e0
commit 06095e3bdc
1 changed files with 2 additions and 0 deletions

View File

@ -538,6 +538,8 @@ export const roll = (rollStr: string, maximizeRoll: boolean, nominalRoll: boolea
// If maximizeRoll is on and we've entered the reroll code, dieSize is not allowed, determine the next best option and always return that // If maximizeRoll is on and we've entered the reroll code, dieSize is not allowed, determine the next best option and always return that
if (!minMaxOverride) { if (!minMaxOverride) {
mmLoop: for (let m = rollConf.dieSize - 1; m > 0; m--) { mmLoop: for (let m = rollConf.dieSize - 1; m > 0; m--) {
loopCountCheck(++loopCount);
if (!rollConf.reroll.nums.includes(m)) { if (!rollConf.reroll.nums.includes(m)) {
minMaxOverride = m; minMaxOverride = m;
break mmLoop; break mmLoop;