my bad hitboxupdate isn't fixed
This commit is contained in:
MasterCatPL 2024-04-13 00:25:51 +02:00
parent 82231a7ca4
commit 59ea88464a
2 changed files with 5 additions and 24 deletions

2
TODO
View File

@ -8,6 +8,8 @@ fix skyboxchanger (not working and crash)
add rev distance to cathook (optional) add rev distance to cathook (optional)
fix hitboxupdate in ESP (crash) i had delete it
need regenerate nav files need regenerate nav files
update ClassIDs update ClassIDs

View File

@ -81,7 +81,7 @@ class ESPData
{ {
public: public:
int string_count{ 0 }; int string_count{ 0 };
std::vector<std::pair<std::string, rgba_t>> strings{}; boost::unordered_flat_map<std::string, rgba_t> strings{};
rgba_t color{ colors::empty }; rgba_t color{ colors::empty };
bool needs_paint{ false }; bool needs_paint{ false };
bool has_collide{ false }; bool has_collide{ false };
@ -94,27 +94,10 @@ boost::unordered_flat_map<u_int16_t, ESPData> data;
inline void AddEntityString(CachedEntity *entity, const std::string &string, const rgba_t &color = colors::empty) inline void AddEntityString(CachedEntity *entity, const std::string &string, const rgba_t &color = colors::empty)
{ {
ESPData &entity_data = data[entity->m_IDX]; ESPData &entity_data = data[entity->m_IDX];
entity_data.strings.emplace_back(string, color); if (entity_data.strings.try_emplace(string, color).second)
++(entity_data.string_count); ++(entity_data.string_count);
entity_data.needs_paint = true; 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 // Sets an entitys esp color
void SetEntityColor(CachedEntity *entity, const rgba_t &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 // Get an entity from the loop tick and process it
ProcessEntity(ent); ProcessEntity(ent);
hitboxUpdate(ent);
ESPData &ent_dat = data.try_emplace(ent->m_IDX, ESPData{}).first->second; ESPData &ent_dat = data.try_emplace(ent->m_IDX, ESPData{}).first->second;
if (ent_dat.needs_paint) if (ent_dat.needs_paint)
@ -413,7 +395,6 @@ static void cm()
if (player) if (player)
{ {
ProcessEntity(ent_index); ProcessEntity(ent_index);
hitboxUpdate(ent_index);
} }
else if (entity_tick) else if (entity_tick)
ProcessEntity(ent_index); ProcessEntity(ent_index);
@ -932,8 +913,6 @@ void ProcessEntityPT()
if (ent_data.string_count) if (ent_data.string_count)
DrawStrings(type, transparent, screen, ent_data, ent); DrawStrings(type, transparent, screen, ent_data, ent);
} }
for (auto &[key, esp_data] : data)
esp_data.strings.clear();
} }
static std::string write_str; static std::string write_str;
// Used to process entities from CreateMove // Used to process entities from CreateMove