This commit is contained in:
shoopea 2019-06-14 14:30:18 +08:00
parent b4d10cc6eb
commit 5453570fca

14
obj.go
View File

@ -613,7 +613,9 @@ func silentGetObjItemID(code string, name string) int64 {
i := v.(ChatWarsItem)
return i.ObjID64
}
item := ChatWarsItem{}
item := ChatWarsItem{
ObjID64: 0,
}
cacheObjItem.Range(func(k, v interface{}) bool {
item = v.(ChatWarsItem)
if ok, _ := regexp.MatchString(`^(a|e|w)[0-9]+$`, item.Code); !ok { //only gear can be custom named
@ -633,11 +635,11 @@ func silentGetObjItemID(code string, name string) int64 {
if item.ObjID64 != 0 {
return item.ObjID64
} else {
fmt.Printf("silentGetObjItemID : Modifier : `%s`\n", r.ReplaceAllString(n, "${Modifier}"))
fmt.Printf("silentGetObjItemID : BaseName : `%s`\n", r.ReplaceAllString(n, "${BaseName}"))
fmt.Printf("silentGetObjItemID : Atk : `%s`\n", r.ReplaceAllString(n, "${Atk}"))
fmt.Printf("silentGetObjItemID : Def : `%s`\n", r.ReplaceAllString(n, "${Def}"))
fmt.Printf("silentGetObjItemID : Mana : `%s`\n", r.ReplaceAllString(n, "${Mana}"))
fmt.Printf("silentGetObjItemID : Modifier : `%s`\n", r.ReplaceAllString(name, "${Modifier}"))
fmt.Printf("silentGetObjItemID : BaseName : `%s`\n", r.ReplaceAllString(name, "${BaseName}"))
fmt.Printf("silentGetObjItemID : Atk : `%s`\n", r.ReplaceAllString(name, "${Atk}"))
fmt.Printf("silentGetObjItemID : Def : `%s`\n", r.ReplaceAllString(name, "${Def}"))
fmt.Printf("silentGetObjItemID : Mana : `%s`\n", r.ReplaceAllString(name, "${Mana}"))
}
}