This commit is contained in:
shoopea 2019-07-08 12:27:36 +08:00
parent cc6836854d
commit 70efa15397
2 changed files with 6 additions and 2 deletions

View File

@ -15,6 +15,12 @@ func reloadObjItem(code string, name string, itemTypeID64 int64, weight int) {
if silentGetObjItemID(``, name) == 0 {
log.Printf("Adding %s to %d.\n", name, objID64)
objAddName(objID64, name)
c := new(ChatWarsItem)
c.ObjID64 = objID64
c.Code = code
c.Name = name
c.Weight = weight
cacheObjItem.Store(name, *c)
}
}

2
obj.go
View File

@ -721,7 +721,6 @@ func loadObjItem() error {
c.Weight = weight
cacheObjItem.Store(intl_id, *c)
cacheObjItem.Store(name, *c)
log.Printf("loadObjItem[%d] : %s : `%s` : %s.\n", id, intl_id, name)
}
items2, err := db.Query(`SELECT oi.obj_id, oi.intl_id, obn.name, oi.weight FROM obj_item oi, obj_name obn WHERE obn.obj_id = oi.obj_id AND obn.priority > 0;`)
@ -743,7 +742,6 @@ func loadObjItem() error {
c.Name = name
c.Weight = weight
cacheObjItem.Store(name, *c)
log.Printf("loadObjItem[%d] : %s : `%s` : %s.\n", id, intl_id, name)
} else {
log.Printf("loadObjItem : orphaned obj_name for `%s` : %s.\n", intl_id, name)
}