diff options
author | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2020-07-31 07:05:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-31 07:05:46 +0200 |
commit | 28caa598e29b7eaa36d0877dd57947d29fe92e06 (patch) | |
tree | 14ce54f1349966ce3482d270c1b104bdac6cc86d /src/Section.cpp | |
parent | Merge pull request #42 from LaG1924/ftr/chat_component_parse (diff) | |
parent | Corrected Game Start conditions (diff) | |
download | AltCraft-28caa598e29b7eaa36d0877dd57947d29fe92e06.tar AltCraft-28caa598e29b7eaa36d0877dd57947d29fe92e06.tar.gz AltCraft-28caa598e29b7eaa36d0877dd57947d29fe92e06.tar.bz2 AltCraft-28caa598e29b7eaa36d0877dd57947d29fe92e06.tar.lz AltCraft-28caa598e29b7eaa36d0877dd57947d29fe92e06.tar.xz AltCraft-28caa598e29b7eaa36d0877dd57947d29fe92e06.tar.zst AltCraft-28caa598e29b7eaa36d0877dd57947d29fe92e06.zip |
Diffstat (limited to 'src/Section.cpp')
-rw-r--r-- | src/Section.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Section.cpp b/src/Section.cpp index 4a15c58..1d9c203 100644 --- a/src/Section.cpp +++ b/src/Section.cpp @@ -61,16 +61,16 @@ BlockId Section::GetBlockId(Vector pos) const { return iter->second; } - int value; + unsigned int value; - unsigned char individualValueMask = ((1 << bitsPerBlock) - 1); + unsigned int individualValueMask = ((1 << (unsigned int)bitsPerBlock) - 1); int blockNumber = (((pos.y * 16) + pos.z) * 16) + pos.x; int startLong = (blockNumber * bitsPerBlock) / 64; int startOffset = (blockNumber * bitsPerBlock) % 64; int endLong = ((blockNumber + 1) * bitsPerBlock - 1) / 64; - unsigned char t; + unsigned int t; if (startLong == endLong) { t = (block[startLong] >> startOffset); @@ -85,7 +85,7 @@ BlockId Section::GetBlockId(Vector pos) const { if (t >= palette.size()) { //LOG(ERROR) << "Out of palette: " << t; - value = 0; + value = t; } else value = palette[t]; |