diff options
author | Tycho Bickerstaff <work.tycho@gmail.com> | 2013-12-22 14:19:27 +0100 |
---|---|---|
committer | Tycho Bickerstaff <work.tycho@gmail.com> | 2013-12-22 14:19:27 +0100 |
commit | 94ca07cfbfe0016d70963c055c87fe14f8622a4d (patch) | |
tree | 28dc91dc948287f802d9628a2ea715e1d4e0be49 /src/ItemGrid.cpp | |
parent | Chunk is now warnings clean (diff) | |
parent | Update GETTING-STARTED.md (diff) | |
download | cuberite-94ca07cfbfe0016d70963c055c87fe14f8622a4d.tar cuberite-94ca07cfbfe0016d70963c055c87fe14f8622a4d.tar.gz cuberite-94ca07cfbfe0016d70963c055c87fe14f8622a4d.tar.bz2 cuberite-94ca07cfbfe0016d70963c055c87fe14f8622a4d.tar.lz cuberite-94ca07cfbfe0016d70963c055c87fe14f8622a4d.tar.xz cuberite-94ca07cfbfe0016d70963c055c87fe14f8622a4d.tar.zst cuberite-94ca07cfbfe0016d70963c055c87fe14f8622a4d.zip |
Diffstat (limited to 'src/ItemGrid.cpp')
-rw-r--r-- | src/ItemGrid.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ItemGrid.cpp b/src/ItemGrid.cpp index e9b86173e..d2e6b1c69 100644 --- a/src/ItemGrid.cpp +++ b/src/ItemGrid.cpp @@ -580,11 +580,11 @@ bool cItemGrid::DamageItem(int a_X, int a_Y, short a_Amount) -void cItemGrid::GenerateRandomLootWithBooks(const cLootProbab * a_LootProbabs, int a_CountLootProbabs, int a_NumSlots, int a_Seed) +void cItemGrid::GenerateRandomLootWithBooks(const cLootProbab * a_LootProbabs, size_t a_CountLootProbabs, int a_NumSlots, int a_Seed) { // Calculate the total weight: int TotalProbab = 1; - for (int i = 0; i < a_CountLootProbabs; i++) + for (size_t i = 0; i < a_CountLootProbabs; i++) { TotalProbab += a_LootProbabs[i].m_Weight; } @@ -597,7 +597,7 @@ void cItemGrid::GenerateRandomLootWithBooks(const cLootProbab * a_LootProbabs, i int LootRnd = Rnd % TotalProbab; Rnd >>= 8; cItem CurrentLoot = cItem(E_ITEM_BOOK, 1, 0); // TODO: enchantment - for (int j = 0; j < a_CountLootProbabs; j++) + for (size_t j = 0; j < a_CountLootProbabs; j++) { LootRnd -= a_LootProbabs[i].m_Weight; if (LootRnd < 0) |