From 59ea88464af7c51c68c4947a4000cc95c9620e74 Mon Sep 17 00:00:00 2001 From: MasterCatPL Date: Sat, 13 Apr 2024 00:25:51 +0200 Subject: [PATCH] ESP fix my bad hitboxupdate isn't fixed --- TODO | 2 ++ src/hacks/ESP.cpp | 27 +++------------------------ 2 files changed, 5 insertions(+), 24 deletions(-) diff --git a/TODO b/TODO index b408974c..404fe3b0 100644 --- a/TODO +++ b/TODO @@ -8,6 +8,8 @@ fix skyboxchanger (not working and crash) add rev distance to cathook (optional) +fix hitboxupdate in ESP (crash) i had delete it + need regenerate nav files update ClassIDs diff --git a/src/hacks/ESP.cpp b/src/hacks/ESP.cpp index 0d8402c2..b3a871b2 100644 --- a/src/hacks/ESP.cpp +++ b/src/hacks/ESP.cpp @@ -81,7 +81,7 @@ class ESPData { public: int string_count{ 0 }; - std::vector> strings{}; + boost::unordered_flat_map strings{}; rgba_t color{ colors::empty }; bool needs_paint{ false }; bool has_collide{ false }; @@ -94,27 +94,10 @@ boost::unordered_flat_map data; inline void AddEntityString(CachedEntity *entity, const std::string &string, const rgba_t &color = colors::empty) { ESPData &entity_data = data[entity->m_IDX]; - entity_data.strings.emplace_back(string, color); - ++(entity_data.string_count); + if (entity_data.strings.try_emplace(string, color).second) + ++(entity_data.string_count); entity_data.needs_paint = true; } -void _FASTCALL hitboxUpdate(CachedEntity *ent) -{ - // Check to prevent crashes - if (CE_BAD(ent) || !ent->m_bAlivePlayer()) - return; - if (ent->m_Type() == ENTITY_PLAYER) - { - auto hit = ent->hitboxes.GetHitbox(0); - if (!hit) - return; - Vector hbm, hbx; - if (draw::WorldToScreen(hit->min, hbm) && draw::WorldToScreen(hit->max, hbx)) - { - Vector head_scr; - } - } -} // Sets an entitys esp color void SetEntityColor(CachedEntity *entity, const rgba_t &color) { @@ -384,7 +367,6 @@ static void cm() // Get an entity from the loop tick and process it ProcessEntity(ent); - hitboxUpdate(ent); ESPData &ent_dat = data.try_emplace(ent->m_IDX, ESPData{}).first->second; if (ent_dat.needs_paint) @@ -413,7 +395,6 @@ static void cm() if (player) { ProcessEntity(ent_index); - hitboxUpdate(ent_index); } else if (entity_tick) ProcessEntity(ent_index); @@ -932,8 +913,6 @@ void ProcessEntityPT() if (ent_data.string_count) DrawStrings(type, transparent, screen, ent_data, ent); } - for (auto &[key, esp_data] : data) - esp_data.strings.clear(); } static std::string write_str; // Used to process entities from CreateMove