1
0

Fixed bug that caused Array Setters to always create segments

This commit is contained in:
Tycho 2014-05-11 18:42:38 +01:00
parent a6940445f6
commit 5d39ecc64b

View File

@ -151,7 +151,7 @@ void cChunkBuffer::SetBlocks(const BLOCKTYPE * a_src)
size_t j = 0;
// do nothing whilst 0
for (; j < segment_length && a_src[i * segment_length + j] == 0; j++);
if (j != segment_length)
if (j != (segment_length - 1))
{
m_Sections[i] = Allocate();
memcpy(
@ -186,7 +186,7 @@ void cChunkBuffer::SetMeta(const NIBBLETYPE * a_src)
size_t j = 0;
// do nothing whilst 0
for (; j < segment_length && a_src[i * segment_length + j] == 0; j++);
if (j != segment_length)
if (j != (segment_length - 1))
{
m_Sections[i] = Allocate();
memcpy(
@ -222,7 +222,7 @@ void cChunkBuffer::SetLight(const NIBBLETYPE * a_src)
size_t j = 0;
// do nothing whilst 0
for (; j < segment_length && a_src[i * segment_length + j] == 0; j++);
if (j != segment_length)
if (j != (segment_length - 1))
{
m_Sections[i] = Allocate();
memcpy(
@ -258,7 +258,7 @@ void cChunkBuffer::SetSkyLight (const NIBBLETYPE * a_src)
size_t j = 0;
// do nothing whilst 0
for (; j < segment_length && a_src[i * segment_length + j] == 0xFF; j++);
if (j != segment_length)
if (j != (segment_length -1))
{
m_Sections[i] = Allocate();
memcpy(