mirror of
https://bitbucket.org/s_l_teichmann/mtsatellite
synced 2024-12-23 16:50: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]
|
version := data[0]
|
||||||
|
|
||||||
contentWidth := int(data[2])
|
contentWidth := Min(int(data[2]), 2)
|
||||||
paramsWidth := int(data[3])
|
paramsWidth := Min(int(data[3]), 2)
|
||||||
|
|
||||||
uncompressedLen := nodeCount * (contentWidth + paramsWidth)
|
uncompressedLen := nodeCount * (contentWidth + paramsWidth)
|
||||||
|
|
||||||
offset := 2
|
var offset int
|
||||||
if version >= 22 {
|
switch {
|
||||||
|
case version >= 27:
|
||||||
|
offset = 6
|
||||||
|
case version >= 22:
|
||||||
offset = 4
|
offset = 4
|
||||||
|
default:
|
||||||
|
offset = 2
|
||||||
}
|
}
|
||||||
|
|
||||||
zr := zlibReaderPool.Get().(interface {
|
zr := zlibReaderPool.Get().(interface {
|
||||||
|
Loading…
Reference in New Issue
Block a user