This commit is contained in:
shoopea 2020-01-12 21:26:31 +08:00
parent e25219bc37
commit 3bc3742bda

8
obj.go
View File

@ -1005,16 +1005,16 @@ func loadObjItem2() error {
logOnError(err, "loadObjItem2 : scanning names")
return err
}
if obj, ok := cacheObjItem[name]; !ok {
if obj2, ok := cacheObjItemId[id]; ok {
log.Printf("loadObjItem2 : %s : orphaned name in database for item %s\n", name, obj2.Code)
if _, ok := cacheObjItem[name]; !ok {
if obj, ok := cacheObjItemId[id]; ok {
log.Printf("loadObjItem2 : %s : orphaned name in database for item %s\n", name, obj.Code)
}
}
}
for _, i := range cacheObjItem {
if i.ObjID64 == 0 {
id, err := addObjItem(i.Code, i.Names[0], i.ItemTypeID, i.Weight, i.Exchange, i.Auction)
id, _ := addObjItem(i.Code, i.Names[0], i.ItemTypeID, i.Weight, i.Exchange, i.Auction)
i.ObjID64 = id
cacheObjItemId[id] = i
count := 0