Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Removed always exploding/rerolling for highest/lowest values and fixed infinite loops #22

Merged
merged 1 commit into from
Oct 24, 2018

Conversation

adrianocola
Copy link
Contributor

Even If a reroll condition was specified (4d6r=4), the lowest dice value would always be rerolled. The same thing happens for exploding dice, but with the highest dice value.

This pull request changes that to only include highest/lowest value to exploding/rerolling if no condition is specified. This is the way the roll20 dice specification works.

I also added a check to explode/reroll conditions to make sure they don't include all dice faces, preventing an infinite loop (1d6r<7 or 1d6!>=1 would execute forever)

Added tests.

…e if a condition is specified. Fixed infinite loops that could happen if exploding/reroll conditions included all dice faces.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants