1
0

Fixed a nasty int overflow bug in blockticking code ( http://forum.mc-server.org/showthread.php?tid=457 )

git-svn-id: http://mc-server.googlecode.com/svn/trunk@533 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
madmaxoft@gmail.com 2012-06-01 06:25:30 +00:00
parent e8c905f078
commit 43c9546203

View File

@ -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;