This commit is contained in:
shoopea 2019-06-06 14:39:56 +08:00
parent f261949c37
commit 9901518a37

4
obj.go
View File

@ -523,7 +523,7 @@ func silentGetObjItemID(c string, n string) int64 {
return i.ObjID64
}
if ok, _ := regexp.MatchString(`u[0-9]+`, c); ok {
r := regexp.MustCompile(`(?P<Modifier>⚡\+[0-9]+) (?P<BaseName>[a-zA-Z ]+)`)
r := regexp.MustCompile(`(?P<Modifier>⚡\+[0-9]+) (?P<BaseName>[a-zA-Z ]+?)( +(?P<Atk>[0-9]+)⚔ +(?P<Def>[0-9]+)🛡){0,1}`)
n2 := r.ReplaceAllString(n, "${BaseName}")
if v, ok := cacheObjItem.Load(n2); ok {
i := v.(ChatWarsItem)
@ -531,7 +531,7 @@ func silentGetObjItemID(c string, n string) int64 {
}
}
if len(c) == 0 {
r := regexp.MustCompile(`(?P<Modifier>⚡\+[0-9]+) (?P<BaseName>[a-zA-Z ]+)`)
r := regexp.MustCompile(`(?P<Modifier>⚡\+[0-9]+) (?P<BaseName>[a-zA-Z ]+?)( +(?P<Atk>[0-9]+)⚔ +(?P<Def>[0-9]+)🛡){0,1}`)
n2 := r.ReplaceAllString(n, "${BaseName}")
if v, ok := cacheObjItem.Load(n2); ok {
i := v.(ChatWarsItem)