From 010a2395bf7ac41e349df47873cbe2a429d751c5 Mon Sep 17 00:00:00 2001 From: Vladimir Hodakov Date: Sat, 2 Dec 2017 18:25:24 +0400 Subject: [PATCH] Fix for low-level: pokememes with same name can be added to hand --- lib/users/parsers.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/users/parsers.go b/lib/users/parsers.go index 1517b61..0639c2e 100644 --- a/lib/users/parsers.go +++ b/lib/users/parsers.go @@ -175,7 +175,7 @@ func (u *Users) ParseProfile(update *tgbotapi.Update, playerRaw *dbmapping.Playe pkName = strings.Replace(pkName, " ⭐", "", 1) pkName = strings.TrimSuffix(pkName, " ") pkName = strings.Split(pkName, "⃣ ")[1] - pokememes[pkName] = pkAttack + pokememes[strconv.Itoa(pi)+"_"+pkName] = pkAttack powerInt += c.Statistics.GetPoints(pkAttack) } } @@ -284,7 +284,9 @@ func (u *Users) ParseProfile(update *tgbotapi.Update, playerRaw *dbmapping.Playe return "fail" } - for meme, attack := range pokememes { + for n_meme, attack := range pokememes { + memeAry := strings.Split(n_meme, "_") + meme := memeAry[1] rarity := "common" if strings.HasPrefix(meme, "🔸") { rarity = "rare"