1
0

Added asserts for cChunk::GetBlockEntity() coords.

This commit is contained in:
Mattes D 2014-06-24 09:46:38 +02:00
parent 742370497a
commit 1da39568a3

View File

@ -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 (