summaryrefslogtreecommitdiffstats
path: root/src/Enchantments.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/Enchantments.h')
-rw-r--r--src/Enchantments.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Enchantments.h b/src/Enchantments.h
index 40dbee038..1f4547058 100644
--- a/src/Enchantments.h
+++ b/src/Enchantments.h
@@ -9,11 +9,11 @@
#pragma once
#include "Defines.h"
+#include "FastRandom.h"
#include "WorldStorage/EnchantmentSerializer.h"
-
// fwd: "WorldStorage/FastNBT.h"
class cFastNBTWriter;
class cParsedNBT;
@@ -27,6 +27,7 @@ typedef std::vector<cWeightedEnchantment> cWeightedEnchantments;
+
/** Class that stores item enchantments or stored-enchantments
The enchantments may be serialized to a stringspec and read back from such stringspec.
The format for the stringspec is "id=lvl;id=lvl;id=lvl...", with an optional semicolon at the end,
@@ -139,8 +140,8 @@ public:
/** Check enchantment conflicts from enchantments from the vector */
static void CheckEnchantmentConflictsFromVector(cWeightedEnchantments & a_Enchantments, const cEnchantments & a_FirstEnchantment);
- /** Gets random enchantment from Vector and returns it */
- static cEnchantments GetRandomEnchantmentFromVector(const cWeightedEnchantments & a_Enchantments);
+ /** Gets random enchantment from Vector and returns it, with randomness derived from the provided PRNG. */
+ static cEnchantments GetRandomEnchantmentFromVector(const cWeightedEnchantments & a_Enchantments, MTRand & a_Random);
/** Selects one enchantment from a Vector using cNoise. Mostly used for generators.
Uses the enchantments' weights for the random distribution.