summaryrefslogtreecommitdiffstats
path: root/src/Enchantments.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2015-07-22 00:40:13 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2015-08-20 17:15:55 +0200
commit5751ba0c1c774d69512cad2bd2c17e40b03af31a (patch)
tree3efe3615509589c8c6360aae490b55c54e4b8d55 /src/Enchantments.cpp
parentMerge pull request #2391 from SamJBarney/CropGrowthFix (diff)
downloadcuberite-5751ba0c1c774d69512cad2bd2c17e40b03af31a.tar
cuberite-5751ba0c1c774d69512cad2bd2c17e40b03af31a.tar.gz
cuberite-5751ba0c1c774d69512cad2bd2c17e40b03af31a.tar.bz2
cuberite-5751ba0c1c774d69512cad2bd2c17e40b03af31a.tar.lz
cuberite-5751ba0c1c774d69512cad2bd2c17e40b03af31a.tar.xz
cuberite-5751ba0c1c774d69512cad2bd2c17e40b03af31a.tar.zst
cuberite-5751ba0c1c774d69512cad2bd2c17e40b03af31a.zip
Diffstat (limited to '')
-rw-r--r--src/Enchantments.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Enchantments.cpp b/src/Enchantments.cpp
index 17c77dd93..34270b2f3 100644
--- a/src/Enchantments.cpp
+++ b/src/Enchantments.cpp
@@ -1040,7 +1040,7 @@ cEnchantments cEnchantments::SelectEnchantmentFromVector(const cWeightedEnchantm
{
// Sum up all the enchantments' weights:
int AllWeights = 0;
- for (const auto Enchantment : a_Enchantments)
+ for (const auto & Enchantment : a_Enchantments)
{
AllWeights += Enchantment.m_Weight;
}
@@ -1054,7 +1054,7 @@ cEnchantments cEnchantments::SelectEnchantmentFromVector(const cWeightedEnchantm
// Pick a random enchantment:
cNoise Noise(a_Seed);
int RandomNumber = Noise.IntNoise1DInt(AllWeights) / 7 % AllWeights;
- for (const auto Enchantment : a_Enchantments)
+ for (const auto & Enchantment : a_Enchantments)
{
RandomNumber -= Enchantment.m_Weight;
if (RandomNumber <= 0)