Merge branch 'aweinstock/small-fix-20210406' into 'master'

Fix loadout_builder panic.

See merge request veloren/veloren!2075
This commit is contained in:
Joshua Barretto 2021-04-06 16:37:19 +00:00
commit 7d75eaedd1

View File

@ -599,7 +599,7 @@ impl LoadoutBuilder {
let mut item_with_amount = |item_id: &str, amount: &mut f32| {
if *amount > 0.0 {
let mut item = Item::new_from_asset_expect(&item_id);
let n = rng.gen_range(0..amount.min(100.0) as u32).max(1);
let n = rng.gen_range(1..(amount.min(100.0) as u32).max(2));
*amount -= if item.set_amount(n).is_ok() {
n as f32
} else {