summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-06-24 09:46:38 +0200
committerMattes D <github@xoft.cz>2014-06-24 09:46:38 +0200
commit1da39568a307db15ba2f03b717506dc1287986bf (patch)
tree10b788b6df9b65c7afed9a501935de9717eca8d2
parentFixed crashes in HopperEntity. (diff)
downloadcuberite-1da39568a307db15ba2f03b717506dc1287986bf.tar
cuberite-1da39568a307db15ba2f03b717506dc1287986bf.tar.gz
cuberite-1da39568a307db15ba2f03b717506dc1287986bf.tar.bz2
cuberite-1da39568a307db15ba2f03b717506dc1287986bf.tar.lz
cuberite-1da39568a307db15ba2f03b717506dc1287986bf.tar.xz
cuberite-1da39568a307db15ba2f03b717506dc1287986bf.tar.zst
cuberite-1da39568a307db15ba2f03b717506dc1287986bf.zip
-rw-r--r--src/Chunk.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Chunk.cpp b/src/Chunk.cpp
index 6ab49036d..1320d5ccd 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 (