From c2befd977727b8091d04db900ede2038e3f755d0 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Wed, 25 Dec 2013 19:38:52 +0100 Subject: Fixed block area height check. The block area couldn't be read up to chunk height. --- src/BlockArea.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/BlockArea.cpp') diff --git a/src/BlockArea.cpp b/src/BlockArea.cpp index a5309f995..03ac13207 100644 --- a/src/BlockArea.cpp +++ b/src/BlockArea.cpp @@ -301,10 +301,10 @@ bool cBlockArea::Read(cWorld * a_World, int a_MinBlockX, int a_MaxBlockX, int a_ LOGWARNING("%s: MaxBlockY less than zero, adjusting to zero", __FUNCTION__); a_MaxBlockY = 0; } - else if (a_MaxBlockY >= cChunkDef::Height) + else if (a_MaxBlockY > cChunkDef::Height) { LOGWARNING("%s: MaxBlockY more than chunk height, adjusting to chunk height", __FUNCTION__); - a_MaxBlockY = cChunkDef::Height - 1; + a_MaxBlockY = cChunkDef::Height; } // Allocate the needed memory: -- cgit v1.2.3 From 5689c001319149a200740969b16688d271b6c749 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 26 Dec 2013 10:56:05 +0100 Subject: cBlockArea: Fixed writing full-height areas. --- src/BlockArea.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/BlockArea.cpp') diff --git a/src/BlockArea.cpp b/src/BlockArea.cpp index 03ac13207..1148908c6 100644 --- a/src/BlockArea.cpp +++ b/src/BlockArea.cpp @@ -349,10 +349,10 @@ bool cBlockArea::Write(cWorld * a_World, int a_MinBlockX, int a_MinBlockY, int a LOGWARNING("%s: MinBlockY less than zero, adjusting to zero", __FUNCTION__); a_MinBlockY = 0; } - else if (a_MinBlockY >= cChunkDef::Height - m_SizeY) + else if (a_MinBlockY > cChunkDef::Height - m_SizeY) { LOGWARNING("%s: MinBlockY + m_SizeY more than chunk height, adjusting to chunk height", __FUNCTION__); - a_MinBlockY = cChunkDef::Height - m_SizeY - 1; + a_MinBlockY = cChunkDef::Height - m_SizeY; } return a_World->WriteBlockArea(*this, a_MinBlockX, a_MinBlockY, a_MinBlockZ, a_DataTypes); -- cgit v1.2.3