diff options
author | Samuel Barney <samjbarney@gmail.com> | 2015-07-29 17:04:03 +0200 |
---|---|---|
committer | Samuel Barney <samjbarney@gmail.com> | 2015-07-29 17:49:30 +0200 |
commit | 804805d35a87c2acc9425d1762ad26b1ba2ec9ac (patch) | |
tree | 13b603c8bbf8177da92ce87f5413fb646d204f3f /src/ItemGrid.cpp | |
parent | Merge pull request #2376 from mjhanninen/fix-freebsd-build (diff) | |
download | cuberite-804805d35a87c2acc9425d1762ad26b1ba2ec9ac.tar cuberite-804805d35a87c2acc9425d1762ad26b1ba2ec9ac.tar.gz cuberite-804805d35a87c2acc9425d1762ad26b1ba2ec9ac.tar.bz2 cuberite-804805d35a87c2acc9425d1762ad26b1ba2ec9ac.tar.lz cuberite-804805d35a87c2acc9425d1762ad26b1ba2ec9ac.tar.xz cuberite-804805d35a87c2acc9425d1762ad26b1ba2ec9ac.tar.zst cuberite-804805d35a87c2acc9425d1762ad26b1ba2ec9ac.zip |
Diffstat (limited to '')
-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 8433598f7..9585ace8f 100644 --- a/src/ItemGrid.cpp +++ b/src/ItemGrid.cpp @@ -256,7 +256,7 @@ int cItemGrid::AddItemToSlot(const cItem & a_ItemStack, int a_Slot, int a_Num, i { PrevCount = m_Slots[a_Slot].m_ItemCount; } - m_Slots[a_Slot].m_ItemCount = std::min(a_MaxStack, PrevCount + a_Num); + m_Slots[a_Slot].m_ItemCount = static_cast<char>(std::min(a_MaxStack, PrevCount + a_Num)); int toReturn = m_Slots[a_Slot].m_ItemCount - PrevCount; TriggerListeners(a_Slot); return toReturn; @@ -660,11 +660,11 @@ void cItemGrid::GenerateRandomLootWithBooks(const cLootProbab * a_LootProbabs, s CurrentLoot = a_LootProbabs[j].m_Item; 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)); + CurrentLoot.m_ItemCount = static_cast<char>(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; + CurrentLoot.m_ItemCount = static_cast<char>(a_LootProbabs[j].m_MinAmount); } Rnd >>= 8; break; |