diff options
author | Howaner <franzi.moos@googlemail.com> | 2014-08-30 12:21:39 +0200 |
---|---|---|
committer | Howaner <franzi.moos@googlemail.com> | 2014-08-30 12:21:39 +0200 |
commit | 80bd0a54579cbe5188d42bf8e1e51724d19a6fcf (patch) | |
tree | 39ded239dea2d76854283a47b3f29cc12b8801e1 /src/Chunk.cpp | |
parent | Added speed entity effect. (diff) | |
parent | cChunk: Fixed the Coords param. (diff) | |
download | cuberite-80bd0a54579cbe5188d42bf8e1e51724d19a6fcf.tar cuberite-80bd0a54579cbe5188d42bf8e1e51724d19a6fcf.tar.gz cuberite-80bd0a54579cbe5188d42bf8e1e51724d19a6fcf.tar.bz2 cuberite-80bd0a54579cbe5188d42bf8e1e51724d19a6fcf.tar.lz cuberite-80bd0a54579cbe5188d42bf8e1e51724d19a6fcf.tar.xz cuberite-80bd0a54579cbe5188d42bf8e1e51724d19a6fcf.tar.zst cuberite-80bd0a54579cbe5188d42bf8e1e51724d19a6fcf.zip |
Diffstat (limited to 'src/Chunk.cpp')
-rw-r--r-- | src/Chunk.cpp | 10 |
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) |