diff options
Diffstat (limited to 'src/Enchantments.cpp')
-rw-r--r-- | src/Enchantments.cpp | 4 |
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) |