loot fixed

This commit is contained in:
william341 2017-07-28 22:31:20 -07:00
parent 56a3080c7b
commit ffdcd39b9a

View file

@ -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;
}