diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-06-01 08:25:30 +0200 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-06-01 08:25:30 +0200 |
commit | 43c9546203f7a90cfd88c80a4d508caea3938e06 (patch) | |
tree | 79e8e07d210a4a80b1c88105f5001e9682f69d16 /source | |
parent | DistortedVoronoi biome generator (diff) | |
download | cuberite-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 |
Diffstat (limited to 'source')
-rw-r--r-- | source/cChunk.cpp | 7 |
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;
|