Merge branch 'heydabop/bug/324-modulo-panic' into 'master'

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

Closes #324

See merge request veloren/veloren!595
This commit is contained in:
Imbris 2019-10-14 03:14:29 +00:00
commit d719c69fca

View File

@ -251,7 +251,7 @@ impl Item {
1 => Self::velorite(),
2 => Item::Tool {
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,
strength: 0,
dexterity: 0,