summaryrefslogtreecommitdiffstats
path: root/source/cChunk.inl.h
diff options
context:
space:
mode:
authorfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-03-10 01:25:05 +0100
committerfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-03-10 01:25:05 +0100
commit62ba8f5a207acb3b7fddbc790c45b01447cfe58f (patch)
tree7df696491273f4050db095f5f5ca890be0d47eb6 /source/cChunk.inl.h
parentcClientHandles have a unique ID now to distinguish them (diff)
downloadcuberite-62ba8f5a207acb3b7fddbc790c45b01447cfe58f.tar
cuberite-62ba8f5a207acb3b7fddbc790c45b01447cfe58f.tar.gz
cuberite-62ba8f5a207acb3b7fddbc790c45b01447cfe58f.tar.bz2
cuberite-62ba8f5a207acb3b7fddbc790c45b01447cfe58f.tar.lz
cuberite-62ba8f5a207acb3b7fddbc790c45b01447cfe58f.tar.xz
cuberite-62ba8f5a207acb3b7fddbc790c45b01447cfe58f.tar.zst
cuberite-62ba8f5a207acb3b7fddbc790c45b01447cfe58f.zip
Diffstat (limited to 'source/cChunk.inl.h')
-rw-r--r--source/cChunk.inl.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/cChunk.inl.h b/source/cChunk.inl.h
index 16d1855dd..4301f0486 100644
--- a/source/cChunk.inl.h
+++ b/source/cChunk.inl.h
@@ -37,7 +37,7 @@ char cChunk::GetNibble(char* a_Buffer, int x, int y, int z)
{
if( x < c_ChunkWidth && x > -1 && y < c_ChunkHeight && y > -1 && z < c_ChunkWidth && z > -1 )
{
- const int cindex = (y/2) + (z * (c_ChunkHeight/2)) + (x * (c_ChunkHeight/2) * c_ChunkWidth);
+ const int cindex = MakeIndexNoCheck(x, y, z)/2;
if( (y & 1) == 0 )
{ // First half byte
return (a_Buffer[cindex] & 0x0f);
@@ -82,7 +82,7 @@ void cChunk::SetNibble(char* a_Buffer, int x, int y, int z, char light)
{
if( x < c_ChunkWidth && x > -1 && y < c_ChunkHeight && y > -1 && z < c_ChunkWidth && z > -1 )
{
- int cindex = (y/2) + (z * (c_ChunkHeight/2)) + (x * (c_ChunkHeight/2) * c_ChunkWidth);
+ int cindex = MakeIndexNoCheck(x, y, z)/2;
if( (y & 1) == 0 )
{ // First half byte
a_Buffer[cindex] &= 0xf0; // Set first half to 0