Skip to content

Commit fdbb03c

Browse files
committed
fix top level bucket going outside the intended bounds
1 parent 3c54db2 commit fdbb03c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/card-draw.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ export function getBuckets(
106106

107107
while (
108108
lvlIndex < availableLvls.length &&
109-
availableLvls[lvlIndex] < low + bucketRangeSize
109+
availableLvls[lvlIndex] < low + bucketRangeSize &&
110+
availableLvls[lvlIndex] < upperBound + 1
110111
) {
111112
lvlIndex++;
112113
}

0 commit comments

Comments
 (0)