Skip to content

Commit

Permalink
add better output logging on error
Browse files Browse the repository at this point in the history
  • Loading branch information
cfi2017 committed Apr 18, 2020
1 parent 40a7826 commit 5d849c2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/item/item.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"fmt"
"hash/crc32"
"io/ioutil"
"log"
"strings"
"sync"

Expand Down Expand Up @@ -212,8 +213,10 @@ func Serialize(item Item, seed int32) ([]byte, error) {
if k, e := btik[strings.ToLower(item.Balance)]; e {
bits := getBits(k, item.Version)
for i := len(item.Generics) - 1; i >= 0; i-- {
err := w.WriteInt(getIndexFor("InventoryGenericPartData", item.Generics[i])+1, bits)
index := getIndexFor("InventoryGenericPartData", item.Generics[i]) + 1
err := w.WriteInt(index, bits)
if err != nil {
log.Printf("tried to fit index %v into %v bits for %s", index, bits, item.Generics[i])
panic(err)
}
}
Expand Down

0 comments on commit 5d849c2

Please sign in to comment.