Skip to content

Commit 4a5ccfb

Browse files
authored
Merge pull request #58 from BennyExtreme/runes-fix
Fix runes changer
2 parents 88dc636 + 4f8aff1 commit 4a5ccfb

1 file changed

Lines changed: 11 additions & 10 deletions

File tree

KBotExt/GameTab.h

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -994,31 +994,32 @@ class GameTab
994994
if (buf.find("grayscale") != std::string::npos)
995995
continue;
996996

997-
if (buf.find("/perk/") != std::string::npos)
997+
if (buf.find("/perkStyle/") != std::string::npos)
998+
{
999+
buf = buf.substr(buf.find("/perkStyle/") + strlen("/perkStyle/"), 4);
1000+
if (primaryPerk.empty())
1001+
primaryPerk = buf;
1002+
else if (secondaryPerk.empty())
1003+
secondaryPerk = buf;
1004+
}
1005+
else if (buf.find("/perk/") != std::string::npos)
9981006
{
9991007
buf = buf.substr(buf.find("/perk/") + strlen("/perk/"), 4);
1000-
std::cout << buf << std::endl;
10011008
runes.emplace_back(buf);
1002-
1003-
if (primaryPerk.empty())
1004-
primaryPerk = buf.substr(0, 2) + "00";
1005-
else if (secondaryPerk.empty() && buf.substr(0, 2) != primaryPerk.substr(0, 2))
1006-
secondaryPerk = buf.substr(0, 2) + "00";
10071009
}
10081010
else if (buf.find("/perkShard/") != std::string::npos)
10091011
{
10101012
buf = buf.substr(buf.find("/perkShard/") + strlen("/perkShard/"), 4);
1011-
std::cout << buf << std::endl;
10121013
runes.emplace_back(buf);
10131014
}
10141015
}
10151016
}
1016-
if (runes.size() != 9)
1017+
if (runes.size() != 9 || primaryPerk.empty() || secondaryPerk.empty())
10171018
{
10181019
return "Failed to fetch op.gg runes";
10191020
}
10201021

1021-
LCU::Request("DELETE", "/lol-perks/v1/page/" + currentPageId);
1022+
LCU::Request("DELETE", "/lol-perks/v1/pages/" + currentPageId);
10221023

10231024
Json::Value rootPage;
10241025
rootPage["name"] = currentChampionName + " OP.GG";

0 commit comments

Comments
 (0)