summaryrefslogtreecommitdiffstats
path: root/src/Chunk.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-08-29 18:19:27 +0200
committerMattes D <github@xoft.cz>2014-08-29 18:19:47 +0200
commit22e3bbd0db71f9bd6d0a4306db1127f257bd24b1 (patch)
tree28c19677ac10421b48ae1a8905c37a05d6785c4f /src/Chunk.cpp
parentVanillaFluidSimulator: Fixed an invalid Y-coord query. (diff)
downloadcuberite-22e3bbd0db71f9bd6d0a4306db1127f257bd24b1.tar
cuberite-22e3bbd0db71f9bd6d0a4306db1127f257bd24b1.tar.gz
cuberite-22e3bbd0db71f9bd6d0a4306db1127f257bd24b1.tar.bz2
cuberite-22e3bbd0db71f9bd6d0a4306db1127f257bd24b1.tar.lz
cuberite-22e3bbd0db71f9bd6d0a4306db1127f257bd24b1.tar.xz
cuberite-22e3bbd0db71f9bd6d0a4306db1127f257bd24b1.tar.zst
cuberite-22e3bbd0db71f9bd6d0a4306db1127f257bd24b1.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)