aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/game/Map.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/game/Map.h b/src/game/Map.h
index f117a1c1cec..334a61cd2ff 100644
--- a/src/game/Map.h
+++ b/src/game/Map.h
@@ -33,6 +33,7 @@
#include "SharedDefines.h"
#include "GameSystem/GridRefManager.h"
#include "MapRefManager.h"
+#include "mersennetwister/MersenneTwister.h"
#include <bitset>
#include <list>
@@ -278,6 +279,33 @@ class TRINITY_DLL_SPEC Map : public GridRefManager<NGridType>, public Trinity::O
template<class NOTIFIER> void VisitWorld(const float &x, const float &y, float radius, NOTIFIER &notifier);
template<class NOTIFIER> void VisitGrid(const float &x, const float &y, float radius, NOTIFIER &notifier);
CreatureGroupHolderType CreatureGroupHolder;
+ MTRand mtRand;
+
+ int32 irand(int32 min, int32 max)
+ {
+ return int32 (mtRand.randInt(max - min)) + min;
+ }
+
+ uint32 urand(uint32 min, uint32 max)
+ {
+ return mtRand.randInt(max - min) + min;
+ }
+
+ int32 rand32()
+ {
+ return mtRand.randInt();
+ }
+
+ double rand_norm(void)
+ {
+ return mtRand.randExc();
+ }
+
+ double rand_chance(void)
+ {
+ return mtRand.randExc(100.0);
+ }
+
private:
void LoadVMap(int pX, int pY);
void LoadMap(uint32 mapid, uint32 instanceid, int x,int y);