Fix trying to roll a zero-sided die error
This commit is contained in:
parent
c7b7e6e3ad
commit
a767b3d6e2
@ -119,6 +119,12 @@ class Dice(Module):
|
||||
size = m[1]
|
||||
if keep > dice or keep == 0:
|
||||
keep = dice
|
||||
if size < 1:
|
||||
output = "# of sides for die is incorrect: %d" % size
|
||||
return output
|
||||
if dice < 1:
|
||||
output = "# of dice is incorrect: %d" % dice
|
||||
return output
|
||||
res = self.roll_dice(keep, dice, size)
|
||||
curr_str += "%d%s" % (res[0], res[1])
|
||||
res = res[0]
|
||||
|
Loading…
Reference in New Issue
Block a user