From 3866f20a0122a1a1b34ca27dd335994da48330a3 Mon Sep 17 00:00:00 2001 From: HimbeerserverDE Date: Sun, 28 Feb 2021 21:45:33 +0100 Subject: [PATCH] Fix #36 --- itemdef.go | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/itemdef.go b/itemdef.go index c6e821c..b9bb7ad 100644 --- a/itemdef.go +++ b/itemdef.go @@ -356,18 +356,20 @@ func mergeItemdefs(mgrs map[string][]byte) error { } } - handdata := rmToolCapabs(handDef) + if len(handDef) < 4 { + handdata := rmToolCapabs(handDef) - var compHanddata bytes.Buffer - handZw := zlib.NewWriter(&compHanddata) - handZw.Write(handdata) - handZw.Close() + var compHanddata bytes.Buffer + handZw := zlib.NewWriter(&compHanddata) + handZw.Write(handdata) + handZw.Close() - hand := &ItemDef{ - name: "", - data: handdata, + hand := &ItemDef{ + name: "", + data: handdata, + } + itemDefs = append(itemDefs, hand) } - itemDefs = append(itemDefs, hand) // Merge definitions into new CItemDefManager mgr := make([]byte, 3)