This commit is contained in:
shoopea 2019-05-25 15:48:34 +08:00
parent 7fce36ae4d
commit bd842800f9

14
obj.go
View File

@ -155,8 +155,8 @@ func addObjCastle(logo string, name string) (int64, error) {
return objId, nil return objId, nil
} }
func getObjCastleID(c string) int64 { func getObjCastleID(s string) int64 {
return cacheObjCastle[c].ObjID64 return cacheObjCastle[s].ObjID64
} }
func loadObjCastle() error { func loadObjCastle() error {
@ -239,8 +239,14 @@ func addObjGuild(tag string, name string) (int64, error) {
return objId, nil return objId, nil
} }
func getObjGuildID(g string) int64 { func getObjGuildID(s string) int64 {
return cacheObjGuild[g].ObjID64 if g, ok := cacheObjGuild[s]; ok {
return g.ObjID64
} else {
addObjGuild(s, ``)
loadObjGuild()
}
return cacheObjGuild[s].ObjID64
} }
func loadObjGuild() error { func loadObjGuild() error {