This commit is contained in:
shoopea 2020-01-12 21:24:05 +08:00
parent 0e777c55b5
commit a1875b160f

8
obj.go
View File

@ -935,7 +935,7 @@ func loadObjItem2() error {
log.Printf("loadObjItems2 : %s : name missing.\n", i.Code)
} else {
if obj, ok := cacheObjItem[i.Code]; ok {
log.Printf("loadObjItem2 : %s : duplicate code found. Belong to %s\n", i.Code, n, obj.Code)
log.Printf("loadObjItem2 : %s : duplicate code found. Belong to %s\n", i.Code, obj.Names[0])
} else {
i2 := ChatWarsItem{
Auction: i.Auction,
@ -988,7 +988,7 @@ func loadObjItem2() error {
if weight != obj.Weight {
log.Printf("loadObjItem2 : %s : weight changed : %d => %d\n", weight, obj.Weight)
}
cacheObjItemID[id] = obj
cacheObjItemId[id] = obj
}
}
@ -1016,11 +1016,11 @@ func loadObjItem2() error {
if i.ObjID64 == 0 {
id, err := addObjItem(i.Code, i.Names[0], i.ItemTypeID, i.Weight, i.Exchange, i.Auction)
i.ObjID64 = id
cacheObjItemID[id] = obj
cacheObjItemId[id] = obj
count := 0
for _, n := range i.Names {
if count == 0 {
cacheObjItemID[n] = obj
cacheObjItemId[n] = obj
continue
} else {
objAddName(id, n)