From 1c03d5e83291bf96e46ebf3cd3389e64ab5dda3a Mon Sep 17 00:00:00 2001 From: Joaquin <67109235+Taiga74164@users.noreply.github.com> Date: Thu, 8 Sep 2022 05:41:15 -0600 Subject: [PATCH] Added BuriedChest to ESP, Fixed #447 pog m0nkrel Co-Authored-By: m0nkrel <84017229+m0nkrel@users.noreply.github.com> --- cheat-library/src/user/cheat/esp/ESP.cpp | 35 ++++++++++++++++++++++-- cheat-library/src/user/cheat/esp/ESP.h | 4 ++- 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/cheat-library/src/user/cheat/esp/ESP.cpp b/cheat-library/src/user/cheat/esp/ESP.cpp index e42c5cd..2a7ae75 100644 --- a/cheat-library/src/user/cheat/esp/ESP.cpp +++ b/cheat-library/src/user/cheat/esp/ESP.cpp @@ -146,6 +146,26 @@ namespace cheat::feature return instance; } + bool ESP::isBuriedChest(game::Entity* entity) + { + if (entity->name().find("_WorldArea_Operator") != std::string::npos) + { + auto entityGameObject = app::MoleMole_BaseEntity_get_rootGameObject(entity->raw(), nullptr); + auto transform = app::GameObject_GetComponentByName(entityGameObject, string_to_il2cppi("Transform"), nullptr); + auto child = app::Transform_FindChild(reinterpret_cast(transform), string_to_il2cppi("CircleR2H2"), nullptr); + if (child == nullptr) + return false; + + auto configID = entity->raw()->fields._configID_k__BackingField; + LOG_DEBUG("%d", configID); + if (configID != 70360001 && configID != 70360286) + return false; + + return true; + } + return false; + } + void ESP::GetNpcName(std::string& name) { if (name.find("Avatar") != std::string::npos) @@ -414,9 +434,18 @@ namespace cheat::feature auto& entry = field.value(); if (!entry.m_Enabled || !m_FilterExecutor.ApplyFilter(entity, filter)) continue; - + if (entry.m_Name == "Buried Chest") + { + if(isBuriedChest(entity)) + { + esp::render::DrawEntity(entry.m_Name, entity, entry.m_Color, entry.m_ContrastColor); + } + break; + } if (entry.m_Name == "Npc" || "AvatarOwn" || "AvatarTeammate") { + if (isBuriedChest(entity)) + continue; if (entity->type() == app::EntityType__Enum_1::Avatar || entity->type() == app::EntityType__Enum_1::NPC) { std::string name = entity->name(); @@ -591,7 +620,7 @@ namespace cheat::feature ADD_FILTER_FIELD(chest, LuxuriousChest); ADD_FILTER_FIELD(chest, RemarkableChest); // Other Chests - //ADD_FILTER_FIELD(chest, BuriedChest); // Shared name, commented for now + ADD_FILTER_FIELD(chest, BuriedChest); ADD_FILTER_FIELD(chest, SearchPoint); @@ -847,4 +876,4 @@ namespace cheat::feature ADD_FILTER_FIELD(puzzle, WindmillMechanism); } #undef ADD_FILTER_FIELD -} +} \ No newline at end of file diff --git a/cheat-library/src/user/cheat/esp/ESP.h b/cheat-library/src/user/cheat/esp/ESP.h index a517605..86fe14e 100644 --- a/cheat-library/src/user/cheat/esp/ESP.h +++ b/cheat-library/src/user/cheat/esp/ESP.h @@ -35,6 +35,7 @@ namespace cheat::feature config::Field f_DrawDistance; config::Field f_DrawName; + //config::Field f_HideCompleted; config::Field f_ArrowRadius; config::Field f_OutlineThickness; config::Field f_TracerSize; @@ -80,7 +81,8 @@ namespace cheat::feature void DrawFilterField(const config::Field& field); void GetNpcName(std::string& name); - + bool isBuriedChest(game::Entity* entity); + void OnKeyUp(short key, bool& cancelled); ESP();