Changed i variable to j
The server wasn't going over all the items before.
This commit is contained in:
parent
5ed6d280ce
commit
07b5ce0c54
@ -654,11 +654,18 @@ void cItemGrid::GenerateRandomLootWithBooks(const cLootProbab * a_LootProbabs, s
|
|||||||
|
|
||||||
for (size_t j = 0; j < a_CountLootProbabs; j++)
|
for (size_t j = 0; j < a_CountLootProbabs; j++)
|
||||||
{
|
{
|
||||||
LootRnd -= a_LootProbabs[i].m_Weight;
|
LootRnd -= a_LootProbabs[j].m_Weight;
|
||||||
if (LootRnd < 0)
|
if (LootRnd < 0)
|
||||||
{
|
{
|
||||||
CurrentLoot = a_LootProbabs[i].m_Item;
|
CurrentLoot = a_LootProbabs[j].m_Item;
|
||||||
CurrentLoot.m_ItemCount = a_LootProbabs[i].m_MinAmount + (Rnd % (a_LootProbabs[i].m_MaxAmount - a_LootProbabs[i].m_MinAmount));
|
if ((a_LootProbabs[j].m_MaxAmount - a_LootProbabs[j].m_MinAmount) > 0)
|
||||||
|
{
|
||||||
|
CurrentLoot.m_ItemCount = a_LootProbabs[j].m_MinAmount + (Rnd % (a_LootProbabs[j].m_MaxAmount - a_LootProbabs[j].m_MinAmount));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
CurrentLoot.m_ItemCount = a_LootProbabs[j].m_MinAmount;
|
||||||
|
}
|
||||||
Rnd >>= 8;
|
Rnd >>= 8;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user