diff options
author | KingCol13 <48412633+KingCol13@users.noreply.github.com> | 2020-10-01 23:33:32 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-01 23:33:32 +0200 |
commit | 8947147c25e2640519897bfdc8807e97ee291d70 (patch) | |
tree | 63eca1e5bd8ad29ac9beba5a780d466c9bb13849 /src/Enchantments.cpp | |
parent | Add SetBlockMeta warning in documentation (#4943) (diff) | |
download | cuberite-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.cpp | 4 |
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; |