From 317efa3b97c401de0838d438eeabd31ae46da11f Mon Sep 17 00:00:00 2001 From: nullifiedcat Date: Wed, 5 Jul 2017 13:27:32 +0300 Subject: [PATCH] fixed emoji esp relying on box esp, tried to fix box/bone esp not working with name/class/etc disabled, but it still doesn't work --- src/hacks/ESP.cpp | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/src/hacks/ESP.cpp b/src/hacks/ESP.cpp index bccd932b..fa729a1f 100644 --- a/src/hacks/ESP.cpp +++ b/src/hacks/ESP.cpp @@ -591,7 +591,7 @@ std::unordered_map bonelist_map {}; CatEnum emoji_esp({ "None", "Joy", "Thinking" }); CatVar joy_esp(CV_SWITCH, "esp_emoji", "0", "Emoji ESP"); CatVar joy_esp_size(CV_FLOAT, "esp_emoji_size", "32", "Emoji ESP Size"); -CatVar emoji_esp_scaling(CV_SWITCH, "esp_emoji_scaling", "0", "Emoji ESP Scaling"); +CatVar emoji_esp_scaling(CV_SWITCH, "esp_emoji_scaling", "1", "Emoji ESP Scaling"); textures::AtlasTexture joy_texture(64 * 4, textures::atlas_height - 64 * 4, 64, 64); textures::AtlasTexture thinking_texture(64 * 5, textures::atlas_height - 64 * 4, 64, 64); @@ -611,6 +611,7 @@ void _FASTCALL ProcessEntityPT(CachedEntity* ent) { ESPData& ent_data = data[ent->m_IDX]; fg = ent_data.color; + if (!fg) fg = ent_data.color = colors::EntityF(ent); if (!draw::EntityCenterToScreen(ent, screen) && !draw::WorldToScreen(ent->m_vecOrigin, origin_screen)) return; @@ -641,30 +642,33 @@ void _FASTCALL ProcessEntityPT(CachedEntity* ent) { } } + if (ent->m_Type == ENTITY_PLAYER) { + if (joy_esp) { + auto hb = ent->hitboxes.GetHitbox(0); + Vector hbm, hbx; + if (draw::WorldToScreen(hb->min, hbm) && draw::WorldToScreen(hb->max, hbx)) { + Vector head_scr; + if (draw::WorldToScreen(hb->center, head_scr)) { + float size = emoji_esp_scaling ? fabs(hbm.y - hbx.y) : float(joy_esp_size); + textures::AtlasTexture* tx = nullptr; + if (int(joy_esp) == 1) tx = &joy_texture; + if (int(joy_esp) == 2) tx = &thinking_texture; + if (tx) + tx->Draw(head_scr.x - size / 2, head_scr.y - size / 2, size, size); + } + } + } + } + if (box_esp) { switch (ent->m_Type) { case ENTITY_PLAYER: { - cloak = IsPlayerInvisible(ent); + //cloak = IsPlayerInvisible(ent); //if (!ent->m_bEnemy && !teammates && playerlist::IsDefault(ent)) break; //if (!ent->m_bAlivePlayer) break; if (vischeck && !ent->IsVisible()) transparent = true; if (!fg) fg = colors::EntityF(ent); if (transparent) fg = colors::Transparent(fg); - if (joy_esp) { - auto hb = ent->hitboxes.GetHitbox(0); - Vector hbm, hbx; - if (draw::WorldToScreen(hb->min, hbm) && draw::WorldToScreen(hb->max, hbx)) { - Vector head_scr; - if (draw::WorldToScreen(hb->center, head_scr)) { - float size = emoji_esp_scaling ? fabs(hbm.y - hbx.y) : float(joy_esp_size); - textures::AtlasTexture* tx = nullptr; - if (int(joy_esp) == 1) tx = &joy_texture; - if (int(joy_esp) == 2) tx = &thinking_texture; - if (tx) - tx->Draw(head_scr.x - size / 2, head_scr.y - size / 2, size, size); - } - } - } DrawBox(ent, fg, static_cast(box_healthbar), CE_INT(ent, netvar.iHealth), ent->m_iMaxHealth); break; }