This commit is contained in:
shoopea 2019-06-06 14:45:04 +08:00
parent 3c075df02d
commit c997cad696

4
obj.go
View File

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