From 2c4612bff1af734898d24bc7def7501ef65b21b9 Mon Sep 17 00:00:00 2001 From: Avi Weinstock Date: Tue, 6 Apr 2021 10:34:13 -0400 Subject: [PATCH] Fix loadout_builder panic. --- common/src/comp/inventory/loadout_builder.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/src/comp/inventory/loadout_builder.rs b/common/src/comp/inventory/loadout_builder.rs index a4952be1e8..44d24ebaa8 100644 --- a/common/src/comp/inventory/loadout_builder.rs +++ b/common/src/comp/inventory/loadout_builder.rs @@ -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 {