fixed exploding dice bug
This commit is contained in:
parent
9b78cf2786
commit
9dd6bee0e3
1 changed files with 1 additions and 4 deletions
|
|
@ -122,9 +122,6 @@ impl Expression {
|
||||||
// Exploding dice are early, they add rolls
|
// Exploding dice are early, they add rolls
|
||||||
if let Some(fragments) = x {
|
if let Some(fragments) = x {
|
||||||
write!(w, "x")?;
|
write!(w, "x")?;
|
||||||
if size < 2 {
|
|
||||||
bail!("Infinite explosion.")
|
|
||||||
}
|
|
||||||
let mut comparers = Vec::with_capacity(fragments.len());
|
let mut comparers = Vec::with_capacity(fragments.len());
|
||||||
for fragment in fragments {
|
for fragment in fragments {
|
||||||
comparers.push(fragment.comparer(rng, w)?);
|
comparers.push(fragment.comparer(rng, w)?);
|
||||||
|
|
@ -301,7 +298,7 @@ impl Expression {
|
||||||
} else {
|
} else {
|
||||||
1
|
1
|
||||||
};
|
};
|
||||||
if count > 1_000_000 {
|
if count > DICE_POOL_LIMIT {
|
||||||
bail!("Too many dice.")
|
bail!("Too many dice.")
|
||||||
};
|
};
|
||||||
let size = size.avg()? as i64;
|
let size = size.avg()? as i64;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue