From 90279506d10046800e5e72a991b5f19208b35636 Mon Sep 17 00:00:00 2001 From: "Sascha L. Teichmann" Date: Thu, 23 Feb 2017 16:08:16 +0100 Subject: [PATCH] Ported new map block offset in version >= 27 from C++ mapper. Needs testing. See https://github.com/minetest/minetestmapper/commit/21444d00c35dc6896ffc27af7da38d8a296178fd --- common/block.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/common/block.go b/common/block.go index 8efae8c..b73a41c 100644 --- a/common/block.go +++ b/common/block.go @@ -105,9 +105,14 @@ func NewDecodedBlock(data []byte, colors *Colors) (db *DecodedBlock, err error) uncompressedLen := nodeCount * (contentWidth + paramsWidth) - offset := 2 - if version >= 22 { + var offset int + switch { + case version >= 27: + offset = 6 + case version >= 22: offset = 4 + default: + offset = 2 } zr := zlibReaderPool.Get().(interface {