summaryrefslogtreecommitdiffstats
path: root/src/ChunkData.h
diff options
context:
space:
mode:
authorTycho <work.tycho+git@gmail.com>2014-05-21 22:18:14 +0200
committerTycho <work.tycho+git@gmail.com>2014-05-21 22:18:14 +0200
commit88c61a2e96af9c7d1b173c0b580cef2c348850d7 (patch)
treef2373625d83aca8b5455fd4f36e6718f5c1dd273 /src/ChunkData.h
parentAdded space to ChunkData.cpp (diff)
downloadcuberite-88c61a2e96af9c7d1b173c0b580cef2c348850d7.tar
cuberite-88c61a2e96af9c7d1b173c0b580cef2c348850d7.tar.gz
cuberite-88c61a2e96af9c7d1b173c0b580cef2c348850d7.tar.bz2
cuberite-88c61a2e96af9c7d1b173c0b580cef2c348850d7.tar.lz
cuberite-88c61a2e96af9c7d1b173c0b580cef2c348850d7.tar.xz
cuberite-88c61a2e96af9c7d1b173c0b580cef2c348850d7.tar.zst
cuberite-88c61a2e96af9c7d1b173c0b580cef2c348850d7.zip
Diffstat (limited to 'src/ChunkData.h')
-rw-r--r--src/ChunkData.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/ChunkData.h b/src/ChunkData.h
index 73b1e8c6a..51244225b 100644
--- a/src/ChunkData.h
+++ b/src/ChunkData.h
@@ -106,7 +106,7 @@ public:
ASSERT((a_Y >= 0) && (a_Y < cChunkDef::Height));
ASSERT((a_Z >= 0) && (a_Z < cChunkDef::Width));
int Section = a_Y / CHUNK_SECTION_HEIGHT;
- if(m_Sections[Section] == NULL)
+ if(m_Sections[Section] != NULL)
{
int Index = cChunkDef::MakeIndexNoCheck(a_X, a_Y - (Section * CHUNK_SECTION_HEIGHT), a_Z);
return m_Sections[Section]->m_BlockTypes[Index];
@@ -130,14 +130,14 @@ public:
}
int Section = a_RelY / CHUNK_SECTION_HEIGHT;
- if(m_Sections[Section] != NULL)
+ if(m_Sections[Section] == NULL)
{
if(a_Block == 0x00)
{
return;
}
m_Sections[Section] = Allocate();
- if(m_Sections[Section] != NULL)
+ if(m_Sections[Section] == NULL)
{
ASSERT(!"Failed to allocate a new section in Chunkbuffer");
return;
@@ -153,7 +153,7 @@ public:
if ((a_RelX < cChunkDef::Width) && (a_RelX > -1) && (a_RelY < cChunkDef::Height) && (a_RelY > -1) && (a_RelZ < cChunkDef::Width) && (a_RelZ > -1))
{
int Section = a_RelY / CHUNK_SECTION_HEIGHT;
- if(m_Sections[Section] == NULL)
+ if(m_Sections[Section] != NULL)
{
int Index = cChunkDef::MakeIndexNoCheck(a_RelX, a_RelY - (Section * CHUNK_SECTION_HEIGHT), a_RelZ);
return (m_Sections[Section]->m_BlockMeta[Index / 2] >> ((Index & 1) * 4)) & 0x0f;
@@ -180,14 +180,14 @@ public:
}
int Section = a_RelY / CHUNK_SECTION_HEIGHT;
- if(m_Sections[Section] != NULL)
+ if(m_Sections[Section] == NULL)
{
if((a_Nibble & 0xf) == 0x00)
{
return false;
}
m_Sections[Section] = Allocate();
- if(m_Sections[Section] != NULL)
+ if(m_Sections[Section] == NULL)
{
ASSERT(!"Failed to allocate a new section in Chunkbuffer");
return false;
@@ -208,7 +208,7 @@ public:
if ((a_RelX < cChunkDef::Width) && (a_RelX > -1) && (a_RelY < cChunkDef::Height) && (a_RelY > -1) && (a_RelZ < cChunkDef::Width) && (a_RelZ > -1))
{
int Section = a_RelY / CHUNK_SECTION_HEIGHT;
- if(m_Sections[Section] == NULL)
+ if(m_Sections[Section] != NULL)
{
int Index = cChunkDef::MakeIndexNoCheck(a_RelX, a_RelY - (Section * CHUNK_SECTION_HEIGHT), a_RelZ);
return (m_Sections[Section]->m_BlockLight[Index / 2] >> ((Index & 1) * 4)) & 0x0f;
@@ -227,7 +227,7 @@ public:
if ((a_RelX < cChunkDef::Width) && (a_RelX > -1) && (a_RelY < cChunkDef::Height) && (a_RelY > -1) && (a_RelZ < cChunkDef::Width) && (a_RelZ > -1))
{
int Section = a_RelY / CHUNK_SECTION_HEIGHT;
- if(m_Sections[Section] == NULL)
+ if(m_Sections[Section] != NULL)
{
int Index = cChunkDef::MakeIndexNoCheck(a_RelX, a_RelY - (Section * CHUNK_SECTION_HEIGHT), a_RelZ);
return (m_Sections[Section]->m_BlockLight[Index / 2] >> ((Index & 1) * 4)) & 0x0f;