This commit is contained in:
shoopea 2020-01-12 20:19:35 +08:00
parent ae41a8e84f
commit 3655c15f4a

6
obj.go
View File

@ -764,7 +764,7 @@ func addObjItem(code string, name string, itemTypeID64 int64, weight int64, exch
} else { } else {
obj.Names = append(obj.Names, name) obj.Names = append(obj.Names, name)
cacheObjItem[code] = obj cacheObjItem[code] = obj
for _, r := range obj.Names { for _, n := range obj.Names {
cacheObjItem[n] = obj cacheObjItem[n] = obj
} }
return obj.ObjID64, nil return obj.ObjID64, nil
@ -1048,9 +1048,9 @@ func loadObjItem() error {
n = append(n, name) n = append(n, name)
c.Names = n c.Names = n
muxObjItem.Lock() muxObjItem.Lock()
cacheObjItem[intl_id] = *c cacheObjItem[intl_id] = c
for _, n := range c.Names { for _, n := range c.Names {
cacheObjItem[name] = *c cacheObjItem[name] = c
} }
muxObjItem.Unlock() muxObjItem.Unlock()
} else { } else {