1
0

Changed cBlockHandler->OnUpdate() to use cChunk directly.

This commit is contained in:
madmaxoft
2013-11-30 15:58:27 +01:00
parent 8eae5f2f3a
commit c70c2fa42f
15 changed files with 117 additions and 63 deletions

View File

@@ -2596,12 +2596,12 @@ void cWorld::TickQueuedBlocks(void)
for (std::vector<BlockTickQueueItem *>::iterator itr = m_BlockTickQueueCopy.begin(); itr != m_BlockTickQueueCopy.end(); itr++)
{
BlockTickQueueItem *Block = (*itr);
BlockTickQueueItem * Block = (*itr);
Block->TicksToWait -= 1;
if (Block->TicksToWait <= 0)
{
// TODO: Handle the case when the chunk is already unloaded
BlockHandler(GetBlock(Block->X, Block->Y, Block->Z))->OnUpdate(this, Block->X, Block->Y, Block->Z);
m_ChunkMap->TickBlock(Block->X, Block->Y, Block->Z);
delete Block; // We don't have to remove it from the vector, this will happen automatically on the next tick
}
else