summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-06-01 08:25:30 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-06-01 08:25:30 +0200
commit43c9546203f7a90cfd88c80a4d508caea3938e06 (patch)
tree79e8e07d210a4a80b1c88105f5001e9682f69d16
parentDistortedVoronoi biome generator (diff)
downloadcuberite-43c9546203f7a90cfd88c80a4d508caea3938e06.tar
cuberite-43c9546203f7a90cfd88c80a4d508caea3938e06.tar.gz
cuberite-43c9546203f7a90cfd88c80a4d508caea3938e06.tar.bz2
cuberite-43c9546203f7a90cfd88c80a4d508caea3938e06.tar.lz
cuberite-43c9546203f7a90cfd88c80a4d508caea3938e06.tar.xz
cuberite-43c9546203f7a90cfd88c80a4d508caea3938e06.tar.zst
cuberite-43c9546203f7a90cfd88c80a4d508caea3938e06.zip
-rw-r--r--source/cChunk.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/source/cChunk.cpp b/source/cChunk.cpp
index de8e3134c..c918c589e 100644
--- a/source/cChunk.cpp
+++ b/source/cChunk.cpp
@@ -519,9 +519,10 @@ void cChunk::Tick(float a_Dt, MTRand & a_TickRandom)
void cChunk::TickBlocks(MTRand & a_TickRandom)
{
// Tick dem blocks
- int RandomX = a_TickRandom.randInt();
- int RandomY = a_TickRandom.randInt();
- int RandomZ = a_TickRandom.randInt();
+ // _X: We must limit the random number or else we get a nasty int overflow bug ( http://forum.mc-server.org/showthread.php?tid=457 )
+ int RandomX = a_TickRandom.randInt(0x00ffffff);
+ int RandomY = a_TickRandom.randInt(0x00ffffff);
+ int RandomZ = a_TickRandom.randInt(0x00ffffff);
int TickX = m_BlockTickX;
int TickY = m_BlockTickY;
int TickZ = m_BlockTickZ;