fixes #324 - changes possible modulo range from 0-29 to 1-29 to prevent mod by 0

This commit is contained in:
heydabop 2019-10-13 21:39:37 -05:00
parent 8d272c8234
commit 522ab2cd98

View File

@ -251,7 +251,7 @@ impl Item {
1 => Self::velorite(), 1 => Self::velorite(),
2 => Item::Tool { 2 => Item::Tool {
kind: *(&ALL_TOOLS).choose(&mut rand::thread_rng()).unwrap(), kind: *(&ALL_TOOLS).choose(&mut rand::thread_rng()).unwrap(),
power: 8 + rand::random::<u32>() % (rand::random::<u32>() % 30), power: 8 + rand::random::<u32>() % (rand::random::<u32>() % 29 + 1),
stamina: 0, stamina: 0,
strength: 0, strength: 0,
dexterity: 0, dexterity: 0,