summaryrefslogtreecommitdiffstats
path: root/src/ChunkData.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ChunkData.cpp')
-rw-r--r--src/ChunkData.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/ChunkData.cpp b/src/ChunkData.cpp
index 160d118ad..7194eca92 100644
--- a/src/ChunkData.cpp
+++ b/src/ChunkData.cpp
@@ -7,7 +7,7 @@ cChunkData cChunkData::Copy() const
cChunkData copy;
for (int i = 0; i < CHUNK_SECTION_NUM; i++)
{
- if(m_Sections[i])
+ if(m_Sections[i] == NULL)
{
copy.m_Sections[i] = Allocate();
*copy.m_Sections[i] = *m_Sections[i];
@@ -30,7 +30,7 @@ void cChunkData::CopyBlocks (BLOCKTYPE * a_dest, size_t a_Idx, size_t length)
{
size_t tocopy = length > segment_length ? segment_length : length;
length -= tocopy;
- if(m_Sections[i])
+ if(m_Sections[i] == NULL)
{
memcpy(
&a_dest[i * segment_length],
@@ -59,7 +59,7 @@ void cChunkData::CopyMeta(NIBBLETYPE * a_dest) const
for (size_t i = 0; i < CHUNK_SECTION_NUM; i++)
{
const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16 / 2;
- if(m_Sections[i])
+ if(m_Sections[i] == NULL)
{
memcpy(
&a_dest[i * segment_length],
@@ -86,7 +86,7 @@ void cChunkData::CopyLight(NIBBLETYPE * a_dest) const
for (size_t i = 0; i < CHUNK_SECTION_NUM; i++)
{
const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16 / 2;
- if(m_Sections[i])
+ if(m_Sections[i] == NULL)
{
memcpy(
&a_dest[i * segment_length],
@@ -114,7 +114,7 @@ void cChunkData::CopySkyLight(NIBBLETYPE * a_dest) const
for (size_t i = 0; i < CHUNK_SECTION_NUM; i++)
{
const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16 / 2;
- if(m_Sections[i])
+ if(m_Sections[i] == NULL)
{
memcpy(
&a_dest[i * segment_length],
@@ -142,7 +142,7 @@ void cChunkData::SetBlocks(const BLOCKTYPE * a_src)
for (size_t i = 0; i < CHUNK_SECTION_NUM; i++)
{
const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16;
- if (m_Sections[i])
+ if (m_Sections[i] == NULL)
{
memcpy(&m_Sections[i]->m_BlockTypes, &a_src[i * segment_length], sizeof(BLOCKTYPE) * segment_length);
}
@@ -180,7 +180,7 @@ void cChunkData::SetMeta(const NIBBLETYPE * a_src)
for (size_t i = 0; i < CHUNK_SECTION_NUM; i++)
{
const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16 / 2;
- if (m_Sections[i])
+ if (m_Sections[i] == NULL)
{
memcpy(&m_Sections[i]->m_BlockMeta, &a_src[i * segment_length], sizeof(NIBBLETYPE) * segment_length);
}
@@ -219,7 +219,7 @@ void cChunkData::SetLight(const NIBBLETYPE * a_src)
for (size_t i = 0; i < CHUNK_SECTION_NUM; i++)
{
const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16 / 2;
- if (m_Sections[i])
+ if (m_Sections[i] == NULL)
{
memcpy(&m_Sections[i]->m_BlockLight, &a_src[i * segment_length], sizeof(NIBBLETYPE) * segment_length);
}
@@ -258,7 +258,7 @@ void cChunkData::SetSkyLight (const NIBBLETYPE * a_src)
for (size_t i = 0; i < CHUNK_SECTION_NUM; i++)
{
const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16 / 2;
- if (m_Sections[i])
+ if (m_Sections[i] == NULL)
{
memcpy(&m_Sections[i]->m_BlockSkyLight, &a_src[i * segment_length], sizeof(NIBBLETYPE) * segment_length);
}