This commit is contained in:
shoopea 2020-01-12 21:30:42 +08:00
parent 3bc3742bda
commit fece838964

12
obj.go
View File

@ -981,13 +981,19 @@ func loadObjItem2() error {
log.Printf("loadObjItem2 : %s : orphaned item in database (id : %d)\n", intl_id, id)
} else {
obj.ObjID64 = id
delete(cacheObjItem, intl_id)
cacheObjItem[intl_id] = obj
for _, n := range obj.Names {
delete(cacheObjItem, n)
cacheObjItem[n] = obj
}
if weight != obj.Weight {
log.Printf("loadObjItem2 : %s : weight changed : %d => %d\n", weight, obj.Weight)
}
cacheObjItemId[id] = obj
}
}
@ -1020,10 +1026,12 @@ func loadObjItem2() error {
count := 0
for _, n := range i.Names {
if count == 0 {
cacheObjItemId[id] = i
delete(cacheObjItem, n)
cacheObjItem[n] = i
continue
} else {
objAddName(id, n)
delete(cacheObjItem, n)
cacheObjItem[n] = i
}
}
@ -1035,7 +1043,7 @@ func loadObjItem2() error {
for _, v := range cacheObjItemId {
log.Printf("Item cached : %d\n", v.ObjID64)
for _, n := range v.Names {
log.Printf("cacheObjItemId[%d] : %s : %s.\n", v.ObjID64, v.Names[0], n)
log.Printf("cacheObjItemId[%d] : %s : %s.\n", v.ObjID64, n)
}
}