summaryrefslogtreecommitdiffstats
path: root/src/Enchantments.cpp
diff options
context:
space:
mode:
authorKingCol13 <48412633+KingCol13@users.noreply.github.com>2020-10-01 23:33:32 +0200
committerGitHub <noreply@github.com>2020-10-01 23:33:32 +0200
commit8947147c25e2640519897bfdc8807e97ee291d70 (patch)
tree63eca1e5bd8ad29ac9beba5a780d466c9bb13849 /src/Enchantments.cpp
parentAdd SetBlockMeta warning in documentation (#4943) (diff)
downloadcuberite-8947147c25e2640519897bfdc8807e97ee291d70.tar
cuberite-8947147c25e2640519897bfdc8807e97ee291d70.tar.gz
cuberite-8947147c25e2640519897bfdc8807e97ee291d70.tar.bz2
cuberite-8947147c25e2640519897bfdc8807e97ee291d70.tar.lz
cuberite-8947147c25e2640519897bfdc8807e97ee291d70.tar.xz
cuberite-8947147c25e2640519897bfdc8807e97ee291d70.tar.zst
cuberite-8947147c25e2640519897bfdc8807e97ee291d70.zip
Diffstat (limited to 'src/Enchantments.cpp')
-rw-r--r--src/Enchantments.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Enchantments.cpp b/src/Enchantments.cpp
index 8eda97eba..e1609bf62 100644
--- a/src/Enchantments.cpp
+++ b/src/Enchantments.cpp
@@ -1170,14 +1170,14 @@ void cEnchantments::CheckEnchantmentConflictsFromVector(
-cEnchantments cEnchantments::GetRandomEnchantmentFromVector(const cWeightedEnchantments & a_Enchantments)
+cEnchantments cEnchantments::GetRandomEnchantmentFromVector(const cWeightedEnchantments & a_Enchantments, MTRand & a_Random)
{
int AllWeights = 0;
for (const auto & Enchantment: a_Enchantments)
{
AllWeights += Enchantment.m_Weight;
}
- int RandomNumber = GetRandomProvider().RandInt(AllWeights - 1);
+ int RandomNumber = a_Random.RandInt(AllWeights - 1);
for (const auto & Enchantment: a_Enchantments)
{
RandomNumber -= Enchantment.m_Weight;