update version checking
This commit is contained in:
parent
d2dff6d73d
commit
a643c8b00a
@ -69,10 +69,6 @@ func parseMetadata(mapblock *MapBlock, data []byte) (int, error) {
|
||||
return cr.Count, nil
|
||||
}
|
||||
|
||||
if version != 2 {
|
||||
return 0, errors.New("Wrong metadata version: " + strconv.Itoa(int(version)))
|
||||
}
|
||||
|
||||
offset++
|
||||
count := readU16(metadata, offset)
|
||||
|
||||
@ -106,8 +102,16 @@ func parseMetadata(mapblock *MapBlock, data []byte) (int, error) {
|
||||
|
||||
pairsMap[key] = value
|
||||
|
||||
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 currentInventory *Inventory
|
||||
|
Loading…
Reference in New Issue
Block a user