update version checking

This commit is contained in:
S Godin 2020-01-13 12:14:04 +00:00
parent d2dff6d73d
commit a643c8b00a

View File

@ -69,10 +69,6 @@ func parseMetadata(mapblock *MapBlock, data []byte) (int, error) {
return cr.Count, nil return cr.Count, nil
} }
if version != 2 {
return 0, errors.New("Wrong metadata version: " + strconv.Itoa(int(version)))
}
offset++ offset++
count := readU16(metadata, offset) count := readU16(metadata, offset)
@ -106,7 +102,15 @@ func parseMetadata(mapblock *MapBlock, data []byte) (int, error) {
pairsMap[key] = value pairsMap[key] = value
offset++ priv := 0
if version >=2 { /* private tag doesn't exist in version=1 */
priv = readU8(metadata, offset)
offset ++
}
if priv != 0 {
// do something usefull
logrus.Info ("Private items in Inventory")
}
} }
var currentInventoryName *string var currentInventoryName *string