Added BuriedChest to ESP, Fixed #447

pog m0nkrel

Co-Authored-By: m0nkrel <84017229+m0nkrel@users.noreply.github.com>
This commit is contained in:
Joaquin 2022-09-08 05:41:15 -06:00
parent 7cd8e725d0
commit e72779a056
2 changed files with 35 additions and 4 deletions

View File

@ -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<app::Transform*>(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
}
}

View File

@ -35,6 +35,7 @@ namespace cheat::feature
config::Field<bool> f_DrawDistance;
config::Field<bool> f_DrawName;
//config::Field<bool> f_HideCompleted;
config::Field<float> f_ArrowRadius;
config::Field<float> f_OutlineThickness;
config::Field<float> f_TracerSize;
@ -80,7 +81,8 @@ namespace cheat::feature
void DrawFilterField(const config::Field<esp::ESPItem>& field);
void GetNpcName(std::string& name);
bool isBuriedChest(game::Entity* entity);
void OnKeyUp(short key, bool& cancelled);
ESP();