From 145ba8e157f79db64203db9684af2e6ed33af075 Mon Sep 17 00:00:00 2001 From: LaG1924 <12997935+LaG1924@users.noreply.github.com> Date: Sun, 3 Sep 2017 20:45:52 +0500 Subject: 2017-09-03 --- src/Section.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Section.cpp') diff --git a/src/Section.cpp b/src/Section.cpp index 9b4292b..554cdbf 100644 --- a/src/Section.cpp +++ b/src/Section.cpp @@ -93,17 +93,17 @@ BlockId Section::GetBlockId(Vector pos) const { return blockId; } -unsigned char Section::GetBlockLight(Vector pos) +unsigned char Section::GetBlockLight(Vector pos) const { int blockNumber = pos.y * 256 + pos.z * 16 + pos.x; - unsigned char lightValue = this->light[blockNumber]; + unsigned char lightValue = this->light[blockNumber / 2]; return (blockNumber % 2 == 0) ? (lightValue & 0xF) : (lightValue >> 4); } -unsigned char Section::GetBlockSkyLight(Vector pos) +unsigned char Section::GetBlockSkyLight(Vector pos) const { int blockNumber = pos.y * 256 + pos.z * 16 + pos.x; - unsigned char skyValue = this->sky[blockNumber]; + unsigned char skyValue = this->sky[blockNumber / 2]; return (blockNumber % 2 == 0) ? (skyValue & 0xF) : (skyValue >> 4); } -- cgit v1.2.3