summaryrefslogtreecommitdiffstats
path: root/src/Chunk.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-06-24 22:15:48 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-06-24 22:15:48 +0200
commitbd5df3d3b975c448e3d8f4227d86a742d0ad3b12 (patch)
tree30193169848d8ea39e2e5a423bd9e1a8e189c5f6 /src/Chunk.cpp
parentConforms to standards (diff)
parentMerge pull request #1125 from Howaner/Entities (diff)
downloadcuberite-bd5df3d3b975c448e3d8f4227d86a742d0ad3b12.tar
cuberite-bd5df3d3b975c448e3d8f4227d86a742d0ad3b12.tar.gz
cuberite-bd5df3d3b975c448e3d8f4227d86a742d0ad3b12.tar.bz2
cuberite-bd5df3d3b975c448e3d8f4227d86a742d0ad3b12.tar.lz
cuberite-bd5df3d3b975c448e3d8f4227d86a742d0ad3b12.tar.xz
cuberite-bd5df3d3b975c448e3d8f4227d86a742d0ad3b12.tar.zst
cuberite-bd5df3d3b975c448e3d8f4227d86a742d0ad3b12.zip
Diffstat (limited to 'src/Chunk.cpp')
-rw-r--r--src/Chunk.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Chunk.cpp b/src/Chunk.cpp
index 0b8e2d1a9..2e14cf368 100644
--- a/src/Chunk.cpp
+++ b/src/Chunk.cpp
@@ -1616,6 +1616,12 @@ void cChunk::AddBlockEntity(cBlockEntity * a_BlockEntity)
cBlockEntity * cChunk::GetBlockEntity(int a_BlockX, int a_BlockY, int a_BlockZ)
{
+ // Check that the query coords are within chunk bounds:
+ ASSERT(a_BlockX >= m_PosX * cChunkDef::Width);
+ ASSERT(a_BlockX < m_PosX * cChunkDef::Width + cChunkDef::Width);
+ ASSERT(a_BlockZ >= m_PosZ * cChunkDef::Width);
+ ASSERT(a_BlockZ < m_PosZ * cChunkDef::Width + cChunkDef::Width);
+
for (cBlockEntityList::iterator itr = m_BlockEntities.begin(); itr != m_BlockEntities.end(); ++itr)
{
if (