From 19086b3ea52cef196c1f72d6ad0c7868db4ba8a4 Mon Sep 17 00:00:00 2001 From: Florian Graf Date: Sat, 7 Dec 2019 20:50:37 +0100 Subject: [PATCH] Fixed incorrect rendering of blocks (issue #1578) The unpacking of the block states missed a single bit when the bits per value was 7. Every 7 bytes it would miss one bit and store it as 0 instead of the actual value. This happened because 0xfc was used instead of 0xfe. 0xfc has six bits set to 1 and two to 0. 0xfe has correctly set seven bits and one bit to 0. We need those seven bits and not just the six. --- overviewer_core/world.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/overviewer_core/world.py b/overviewer_core/world.py index 4db4151..ae88913 100644 --- a/overviewer_core/world.py +++ b/overviewer_core/world.py @@ -1189,7 +1189,7 @@ class RegionSet(object): result[4::8] = ((b[4::7] & 0x07) << 4) | ((b[3::7] & 0xf0) >> 4) result[5::8] = ((b[5::7] & 0x03) << 5) | ((b[4::7] & 0xf8) >> 3) result[6::8] = ((b[6::7] & 0x01) << 6) | ((b[5::7] & 0xfc) >> 2) - result[7::8] = (b[6::7] & 0xfc) >> 1 + result[7::8] = (b[6::7] & 0xfe) >> 1 # bits_per_value == 8 is handled above elif bits_per_value == 9: result[0::8] = ((b[1::9] & 0x01) << 8) | b[0::9]