From 25ec7750aac9800bec83a844020a6eeda5cd4d74 Mon Sep 17 00:00:00 2001 From: Tycho Date: Fri, 31 Jan 2014 15:17:41 -0800 Subject: Changed signitures of Several BLockHandler Methods Changed the signitures of the following to use interfaces: GetPlacementBlockTypeMeta OnPlaced OnPlacedByPlayer OnDestroyed OnNeighbourChanged NeighbourChanged OnUse CanBeAt Check --- src/Chunk.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/Chunk.cpp') diff --git a/src/Chunk.cpp b/src/Chunk.cpp index a72464ec3..4fdaf4b69 100644 --- a/src/Chunk.cpp +++ b/src/Chunk.cpp @@ -753,7 +753,7 @@ void cChunk::BroadcastPendingBlockChanges(void) -void cChunk::CheckBlocks(void) +void cChunk::CheckBlocks() { if (m_ToTickBlocks.size() == 0) { @@ -762,13 +762,15 @@ void cChunk::CheckBlocks(void) std::vector ToTickBlocks; std::swap(m_ToTickBlocks, ToTickBlocks); + cChunkInterface ChunkInterface(m_World->GetChunkMap()); + for (std::vector::const_iterator itr = ToTickBlocks.begin(), end = ToTickBlocks.end(); itr != end; ++itr) { unsigned int index = (*itr); Vector3i BlockPos = IndexToCoordinate(index); cBlockHandler * Handler = BlockHandler(GetBlock(index)); - Handler->Check(BlockPos.x, BlockPos.y, BlockPos.z, *this); + Handler->Check(&ChunkInterface, BlockPos.x, BlockPos.y, BlockPos.z, *this); } // for itr - ToTickBlocks[] } -- cgit v1.2.3