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
This commit is contained in:
nullifiedcat 2017-07-05 13:27:32 +03:00
parent 0edfa592a8
commit 317efa3b97

View File

@ -591,7 +591,7 @@ std::unordered_map<studiohdr_t*, bonelist_s> 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<bool>(box_healthbar), CE_INT(ent, netvar.iHealth), ent->m_iMaxHealth);
break;
}