From 9dd6bee0e350a89be3eec67caefc1bb6ff089685 Mon Sep 17 00:00:00 2001 From: Lilith Schier Date: Thu, 20 Aug 2026 01:30:31 +0200 Subject: [PATCH] fixed exploding dice bug --- src/dice.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/dice.rs b/src/dice.rs index 11c267d..9c1b21e 100644 --- a/src/dice.rs +++ b/src/dice.rs @@ -122,9 +122,6 @@ impl Expression { // Exploding dice are early, they add rolls if let Some(fragments) = x { write!(w, "x")?; - if size < 2 { - bail!("Infinite explosion.") - } let mut comparers = Vec::with_capacity(fragments.len()); for fragment in fragments { comparers.push(fragment.comparer(rng, w)?); @@ -301,7 +298,7 @@ impl Expression { } else { 1 }; - if count > 1_000_000 { + if count > DICE_POOL_LIMIT { bail!("Too many dice.") }; let size = size.avg()? as i64;