From 5d39ecc64b3c690b2da05936c73c9442511b9509 Mon Sep 17 00:00:00 2001 From: Tycho Date: Sun, 11 May 2014 18:42:38 +0100 Subject: Fixed bug that caused Array Setters to always create segments --- src/ChunkBuffer.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/ChunkBuffer.cpp') diff --git a/src/ChunkBuffer.cpp b/src/ChunkBuffer.cpp index 73ccd9c02..141601113 100644 --- a/src/ChunkBuffer.cpp +++ b/src/ChunkBuffer.cpp @@ -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( -- cgit v1.2.3