1
1
mirror of https://github.com/Burn-E99/TheArtificer.git synced 2026-06-04 09:03:50 -04:00

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

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;