summaryrefslogtreecommitdiffstats
path: root/src/Chunk.cpp
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-08-30 22:17:49 +0200
committermadmaxoft <github@xoft.cz>2014-08-30 22:17:49 +0200
commit26b8471280b876f624abb07db6616e67c11f5faa (patch)
treee058274eb79850074b2502a0a39a72c9b37e08fc /src/Chunk.cpp
parentUpdated Core (diff)
parentWSSAnvil: Removed leftover debugging code. (diff)
downloadcuberite-26b8471280b876f624abb07db6616e67c11f5faa.tar
cuberite-26b8471280b876f624abb07db6616e67c11f5faa.tar.gz
cuberite-26b8471280b876f624abb07db6616e67c11f5faa.tar.bz2
cuberite-26b8471280b876f624abb07db6616e67c11f5faa.tar.lz
cuberite-26b8471280b876f624abb07db6616e67c11f5faa.tar.xz
cuberite-26b8471280b876f624abb07db6616e67c11f5faa.tar.zst
cuberite-26b8471280b876f624abb07db6616e67c11f5faa.zip
Diffstat (limited to 'src/Chunk.cpp')
-rw-r--r--src/Chunk.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/Chunk.cpp b/src/Chunk.cpp
index 116c0f3a0..40ffff834 100644
--- a/src/Chunk.cpp
+++ b/src/Chunk.cpp
@@ -296,6 +296,16 @@ void cChunk::SetAllData(cSetChunkData & a_SetChunkData)
}
m_BlockEntities.clear();
std::swap(a_SetChunkData.GetBlockEntities(), m_BlockEntities);
+
+ // Check that all block entities have a valid blocktype at their respective coords (DEBUG-mode only):
+ #ifdef _DEBUG
+ for (cBlockEntityList::iterator itr = m_BlockEntities.begin(); itr != m_BlockEntities.end(); ++itr)
+ {
+ BLOCKTYPE EntityBlockType = (*itr)->GetBlockType();
+ BLOCKTYPE WorldBlockType = GetBlock((*itr)->GetRelX(), (*itr)->GetPosY(), (*itr)->GetRelZ());
+ ASSERT(EntityBlockType == WorldBlockType);
+ } // for itr - m_BlockEntities
+ #endif // _DEBUG
// Set all block entities' World variable:
for (cBlockEntityList::iterator itr = m_BlockEntities.begin(); itr != m_BlockEntities.end(); ++itr)