From 86e30c992f73c94032299c9748b3883bb67f8faf Mon Sep 17 00:00:00 2001 From: m0nkrel Date: Thu, 21 Jul 2022 16:08:53 +0300 Subject: [PATCH 1/2] Hotfix #323 --- cheat-library/src/user/cheat/esp/ESP.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/cheat-library/src/user/cheat/esp/ESP.cpp b/cheat-library/src/user/cheat/esp/ESP.cpp index 3da2995..6b0c6ab 100644 --- a/cheat-library/src/user/cheat/esp/ESP.cpp +++ b/cheat-library/src/user/cheat/esp/ESP.cpp @@ -316,10 +316,13 @@ namespace cheat::feature if (entry.m_Name == "Npc" || "AvatarOwn" || "AvatarTeammate") { - auto name = entity->name(); - GetNpcName(name); - esp::render::DrawEntity(name, entity, entry.m_Color, entry.m_ContrastColor); - break; + if (entity->type() == app::EntityType__Enum_1::Avatar || entity->type() == app::EntityType__Enum_1::NPC) + { + std::string name = entity->name(); + GetNpcName(name); + esp::render::DrawEntity(name, entity, entry.m_Color, entry.m_ContrastColor); + break; + } } esp::render::DrawEntity(entry.m_Name, entity, entry.m_Color, entry.m_ContrastColor); From f528cb882d9889a9bb522416af91e0e2bc89415d Mon Sep 17 00:00:00 2001 From: m0nkrel Date: Thu, 21 Jul 2022 18:18:57 +0300 Subject: [PATCH 2/2] Added Animal and Monster NPC support --- cheat-library/src/user/cheat/esp/ESP.cpp | 92 ++++++++++++++++++- cheat-library/src/user/cheat/game/filters.cpp | 2 +- 2 files changed, 92 insertions(+), 2 deletions(-) diff --git a/cheat-library/src/user/cheat/esp/ESP.cpp b/cheat-library/src/user/cheat/esp/ESP.cpp index 6b0c6ab..95f94f6 100644 --- a/cheat-library/src/user/cheat/esp/ESP.cpp +++ b/cheat-library/src/user/cheat/esp/ESP.cpp @@ -173,6 +173,97 @@ namespace cheat::feature } name = name.substr(pos1 + 1, pos2 - pos1 - 1); } + else if (name.find("Animal") != std::string::npos) + { + int count = 0; + int j = 0; + int pos1 = 0; + int pos2 = 0; + for (int i = 0; i < name.length(); i++) + { + if (name[i] == '_') + { + count++; + } + } + //switch statement to determine how we will get name + switch (count) + { + case 3: + { + j = 0; // j is the number of spaces before the name starts + pos1 = 0; + pos2 = 0; + for (int i = 0; i < name.length(); i++) + { + if (name[i] == '_') + { + j++; + if (j == 3) + { + pos1 = i; + } + + } + if (name[i] == '(') + { + pos2 = i; + break; + } + } + name = name.substr(pos1, pos2 - pos1); + } + case 4: + { + j = 0; // j is the number of spaces before the name starts + pos1 = 0; + pos2 = 0; + for (int i = 0; i < name.length(); i++) + { + if (name[i] == '_') + { + j++; + if (j == 3) + { + pos1 = i; + } + if (j == 4) + { + pos2 = i; + break; + } + } + } + name = name.substr(pos1 + 1, pos2 - pos1 - 1); + } + default: + break; + } + return; + } + else if (name.find("Monster") != std::string::npos) + { + int j = 0; //number of underscores in the name + int pos1 = 0; //position of the first underscore in the name + int pos2 = 0; //position of the second underscore in the name + for (int i = 0; i < name.length(); i++) + { + if (name[i] == '_') + { + j++; + if (j == 3) + { + pos1 = i; + } + if (j == 4) + { + pos2 = i; + break; + } + } + } + name = name.substr(pos1 + 1, pos2 - pos1 - 1); + } else { int j = 0; //number of underscores in the name @@ -324,7 +415,6 @@ namespace cheat::feature break; } } - esp::render::DrawEntity(entry.m_Name, entity, entry.m_Color, entry.m_ContrastColor); break; } diff --git a/cheat-library/src/user/cheat/game/filters.cpp b/cheat-library/src/user/cheat/game/filters.cpp index 6b52379..85babfd 100644 --- a/cheat-library/src/user/cheat/game/filters.cpp +++ b/cheat-library/src/user/cheat/game/filters.cpp @@ -95,7 +95,7 @@ namespace cheat::game::filters SimpleFilter Boar = { EntityType__Enum_1::Monster, "Boar" }; SimpleFilter Fox = { EntityType__Enum_1::Monster, "Fox" }; SimpleFilter Squirrel = { EntityType__Enum_1::Monster, "Squirrel" }; - SimpleFilter Npc = { EntityType__Enum_1::NPC, { "_Liyue", "_Mengde", "_Inazuma", "_Coop", "_Quest", "_Enkanomiya", "_Animal", "_Guide", "_Homeworld" } }; + SimpleFilter Npc = { EntityType__Enum_1::NPC, { "_Liyue", "_Mengde", "_Inazuma", "_Coop", "_Quest", "_Enkanomiya", "_Animal", "_Guide", "_Homeworld", "_Monster"}}; SimpleFilter Crane = { EntityType__Enum_1::Monster, "Crane" }; SimpleFilter Falcon = { EntityType__Enum_1::Monster, "Falcon" }; SimpleFilter LucklightFly = { EntityType__Enum_1::EnvAnimal, "Boltbug_" };