summaryrefslogtreecommitdiffstats
path: root/src/ItemGrid.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-10-16 12:28:53 +0200
committerMattes D <github@xoft.cz>2014-10-16 12:28:53 +0200
commit3d05b46c6020231856eefd34d1e03f74cef2ddbe (patch)
tree68da8240d628a15f375e8820720b257e254b5e0a /src/ItemGrid.cpp
parentBioGen: Fixed a compiler warning. (diff)
parentMerge branch 'master' into DungeonLoot (diff)
downloadcuberite-3d05b46c6020231856eefd34d1e03f74cef2ddbe.tar
cuberite-3d05b46c6020231856eefd34d1e03f74cef2ddbe.tar.gz
cuberite-3d05b46c6020231856eefd34d1e03f74cef2ddbe.tar.bz2
cuberite-3d05b46c6020231856eefd34d1e03f74cef2ddbe.tar.lz
cuberite-3d05b46c6020231856eefd34d1e03f74cef2ddbe.tar.xz
cuberite-3d05b46c6020231856eefd34d1e03f74cef2ddbe.tar.zst
cuberite-3d05b46c6020231856eefd34d1e03f74cef2ddbe.zip
Diffstat (limited to 'src/ItemGrid.cpp')
-rw-r--r--src/ItemGrid.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/ItemGrid.cpp b/src/ItemGrid.cpp
index 7ebc419cb..0bd44bb0d 100644
--- a/src/ItemGrid.cpp
+++ b/src/ItemGrid.cpp
@@ -654,17 +654,17 @@ void cItemGrid::GenerateRandomLootWithBooks(const cLootProbab * a_LootProbabs, s
for (size_t j = 0; j < a_CountLootProbabs; j++)
{
- LootRnd -= a_LootProbabs[i].m_Weight;
+ LootRnd -= a_LootProbabs[j].m_Weight;
if (LootRnd < 0)
{
- CurrentLoot = a_LootProbabs[i].m_Item;
- if ((a_LootProbabs[i].m_MaxAmount - a_LootProbabs[i].m_MinAmount) > 0)
+ CurrentLoot = a_LootProbabs[j].m_Item;
+ if ((a_LootProbabs[j].m_MaxAmount - a_LootProbabs[j].m_MinAmount) > 0)
{
- CurrentLoot.m_ItemCount = a_LootProbabs[i].m_MinAmount + (Rnd % (a_LootProbabs[i].m_MaxAmount - a_LootProbabs[i].m_MinAmount));
+ 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[i].m_MinAmount;
+ CurrentLoot.m_ItemCount = a_LootProbabs[j].m_MinAmount;
}
Rnd >>= 8;
break;