diff options
| author | william341 <[email protected]> | 2017-07-28 22:31:20 -0700 |
|---|---|---|
| committer | william341 <[email protected]> | 2017-07-28 22:31:20 -0700 |
| commit | ffdcd39b9a10738f4880848631b920eebd5a7f18 (patch) | |
| tree | 2e50ccdc838f389c5e3b7169ff38c4be6275cc67 | |
| parent | 56a3080c7bcf5a836de817807cda64216c184659 (diff) | |
| download | shiftos_thereturn-ffdcd39b9a10738f4880848631b920eebd5a7f18.tar.gz shiftos_thereturn-ffdcd39b9a10738f4880848631b920eebd5a7f18.tar.bz2 shiftos_thereturn-ffdcd39b9a10738f4880848631b920eebd5a7f18.zip | |
loot fixed
| -rw-r--r-- | ShiftOS_TheReturn/Hacking.cs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ShiftOS_TheReturn/Hacking.cs b/ShiftOS_TheReturn/Hacking.cs index 1eb1892..b9149d9 100644 --- a/ShiftOS_TheReturn/Hacking.cs +++ b/ShiftOS_TheReturn/Hacking.cs @@ -109,11 +109,11 @@ namespace ShiftOS.Engine List<Objects.Loot> loot = new List<Objects.Loot>(); loot.AddRange(LootFiles.Where(x => x.Rarity <= hsys.Data.LootRarity)); var amount = data.LootAmount; - for (int i = 0; i < amount && i < loot.Count - 1; i++) + for (int i = 0; i < amount; i++) { - var randomLoot = loot[rnd.Next(0, loot.Count - 1)]; - hsys.ServerFTPLoot.Add(randomLoot); - loot.Remove(randomLoot); + int idx = rnd.Next(0, loot.Count - 1); + hsys.ServerFTPLoot.Add(loot[idx]); + loot.RemoveAt(idx); } CurrentHackable = hsys; } |
