1
0

Fixed FS #243, server crash after restart. The blockhandler table and the itemhandler table weren't properly re-initialized.

git-svn-id: http://mc-server.googlecode.com/svn/trunk@830 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
madmaxoft@gmail.com
2012-09-04 15:07:08 +00:00
parent c2288fce98
commit 58b1b3160d
3 changed files with 239 additions and 115 deletions

View File

@@ -580,15 +580,22 @@ void cChunk::TickBlocks(MTRand & a_TickRandom)
default:
{
cBlockHandler *Handler = BlockHandler(ID);
if(Handler->NeedsRandomTicks())
Handler->OnUpdate(m_World, m_BlockTickX + m_PosX*Width, m_BlockTickY, m_BlockTickZ + m_PosZ*Width);
cBlockHandler * Handler = BlockHandler(ID);
ASSERT(Handler != NULL); // Happenned on server restart, FS #243
if (Handler->NeedsRandomTicks())
{
Handler->OnUpdate(m_World, m_BlockTickX + m_PosX * Width, m_BlockTickY, m_BlockTickZ + m_PosZ * Width);
}
break;
}
}
}
}
void cChunk::TickMelonPumpkin(int a_RelX, int a_RelY, int a_RelZ, int a_BlockIdx, BLOCKTYPE a_BlockType, MTRand & a_TickRandom)
{
NIBBLETYPE Meta = GetMeta(a_BlockIdx);