mirror of
https://bitbucket.org/s_l_teichmann/mtsatellite
synced 2024-12-23 08:40:18 +01:00
Merged branch new-mapblock-v27. Fixes #21 .
This commit is contained in:
commit
9e62c6c318
@ -100,14 +100,19 @@ func NewDecodedBlock(data []byte, colors *Colors) (db *DecodedBlock, err error)
|
||||
|
||||
version := data[0]
|
||||
|
||||
contentWidth := int(data[2])
|
||||
paramsWidth := int(data[3])
|
||||
contentWidth := Min(int(data[2]), 2)
|
||||
paramsWidth := Min(int(data[3]), 2)
|
||||
|
||||
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 {
|
||||
|
Loading…
Reference in New Issue
Block a user