diff options
author | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2018-03-13 15:30:05 +0100 |
---|---|---|
committer | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2018-03-13 16:41:49 +0100 |
commit | cf647ebf504eb523d822fa79622cb59d009680da (patch) | |
tree | efaa792f312bb18db07c94d1460801209279ed3f /src/Section.cpp | |
parent | Fixed holes when block on section border destroyed (diff) | |
download | AltCraft-cf647ebf504eb523d822fa79622cb59d009680da.tar AltCraft-cf647ebf504eb523d822fa79622cb59d009680da.tar.gz AltCraft-cf647ebf504eb523d822fa79622cb59d009680da.tar.bz2 AltCraft-cf647ebf504eb523d822fa79622cb59d009680da.tar.lz AltCraft-cf647ebf504eb523d822fa79622cb59d009680da.tar.xz AltCraft-cf647ebf504eb523d822fa79622cb59d009680da.tar.zst AltCraft-cf647ebf504eb523d822fa79622cb59d009680da.zip |
Diffstat (limited to 'src/Section.cpp')
-rw-r--r-- | src/Section.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Section.cpp b/src/Section.cpp index 71937e2..1f60471 100644 --- a/src/Section.cpp +++ b/src/Section.cpp @@ -46,7 +46,7 @@ Section::Section(Vector pos, unsigned char bitsPerBlock, std::vector<unsigned sh this->worldPosition = pos; this->block = std::move(blockData); this->palette = std::move(palette); - this->light = std::move(lightData); + this->light = std::move(lightData); this->sky = std::move(skyData); hash = -1; @@ -99,12 +99,12 @@ BlockId Section::GetBlockId(Vector pos) const { unsigned char Section::GetBlockLight(Vector pos) const { - if (light.empty()) - return 0; + if (light.empty()) + return 0; - int blockNumber = pos.y * 256 + pos.z * 16 + pos.x; - unsigned char lightValue = this->light[blockNumber / 2]; - return (blockNumber % 2 == 0) ? (lightValue & 0xF) : (lightValue >> 4); + int blockNumber = pos.y * 256 + pos.z * 16 + pos.x; + unsigned char lightValue = this->light[blockNumber / 2]; + return (blockNumber % 2 == 0) ? (lightValue & 0xF) : (lightValue >> 4); } unsigned char Section::GetBlockSkyLight(Vector pos) const |