From 6493073fd3f8c77054233973296d196c65053932 Mon Sep 17 00:00:00 2001 From: nullifiedcat Date: Tue, 11 Apr 2017 14:49:54 +0300 Subject: [PATCH] fix: melee crit hack doesn't work, made 3d box for invis spies transparent --- src/crits.cpp | 6 +++--- src/hacks/ESP.cpp | 6 ++++-- src/helpers.cpp | 2 +- src/hooks/others.cpp | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/crits.cpp b/src/crits.cpp index 114ef3f4..9e27d1ba 100644 --- a/src/crits.cpp +++ b/src/crits.cpp @@ -14,13 +14,13 @@ std::unordered_map command_number_mod {}; bool AllowAttacking() { - if (!hacks::shared::misc::crit_hack) return true; + if (!(hacks::shared::misc::crit_hack || ((GetWeaponMode(LOCAL_E) == weapon_melee) && hacks::shared::misc::crit_melee))) return true; bool crit = IsAttackACrit(g_pUserCmd); - if (hacks::shared::misc::crit_suppress && !hacks::shared::misc::crit_hack && WeaponCanCrit()) { + if (hacks::shared::misc::crit_suppress && !(hacks::shared::misc::crit_hack || ((GetWeaponMode(LOCAL_E) == weapon_melee) && hacks::shared::misc::crit_melee))) { if (crit && !IsPlayerCritBoosted(LOCAL_E)) { return false; } - } else if (((GetWeaponMode(LOCAL_E) == weapon_melee && hacks::shared::misc::crit_melee) || hacks::shared::misc::crit_hack) && RandomCrits() && WeaponCanCrit() && (g_pLocalPlayer->weapon()->m_iClassID != g_pClassID->CTFKnife)) { + } else if ((hacks::shared::misc::crit_hack || ((GetWeaponMode(LOCAL_E) == weapon_melee) && hacks::shared::misc::crit_melee)) && RandomCrits() && WeaponCanCrit() && (g_pLocalPlayer->weapon()->m_iClassID != g_pClassID->CTFKnife)) { if (!crit) return false; } return true; diff --git a/src/hacks/ESP.cpp b/src/hacks/ESP.cpp index 402b776b..e19e7181 100644 --- a/src/hacks/ESP.cpp +++ b/src/hacks/ESP.cpp @@ -157,7 +157,8 @@ void Draw3DBox(CachedEntity* ent, int clr, bool healthbar, int health, int healt }; if (esp_3d_box_health) clr = colors::Health(health, healthmax); - + bool cloak = ent->m_iClassID == g_pClassID->C_Player && IsPlayerInvisible(ent); + if (cloak) clr = colors::Transparent(clr, 0.2); for (int i = 0; i < 12; i++) { const Vector& p1 = points[indices[i][0]]; const Vector& p2 = points[indices[i][1]]; @@ -339,7 +340,8 @@ void ProcessEntity(CachedEntity* ent) { }*/ } if (power >= 0) { - AddEntityString(ent, format("HAS ", powerups[power])); + // FIXME Disabled powerup ESP. + //AddEntityString(ent, format("HAS ", powerups[power])); } if (ent->m_bEnemy || teammates || GetRelation(ent)) { if (show_name) diff --git a/src/helpers.cpp b/src/helpers.cpp index 26d0c72e..fee1bde1 100644 --- a/src/helpers.cpp +++ b/src/helpers.cpp @@ -464,7 +464,7 @@ weaponmode GetWeaponMode(CachedEntity* player) { } CachedEntity* weapon = (ENTITY(weapon_handle & 0xFFF)); if (CE_BAD(weapon)) return weaponmode::weapon_invalid; - if (IsMeleeWeapon(weapon)) return weaponmode::weapon_melee; + if (vfunc(RAW_ENT(g_pLocalPlayer->weapon()), 395, 0)(RAW_ENT(g_pLocalPlayer->weapon())) == 2) return weaponmode::weapon_melee; if (weapon->m_iClassID == g_pClassID->CTFLunchBox || weapon->m_iClassID == g_pClassID->CTFLunchBox_Drink || weapon->m_iClassID == g_pClassID->CTFBuffItem) { diff --git a/src/hooks/others.cpp b/src/hooks/others.cpp index 92bca6a2..634e78c9 100644 --- a/src/hooks/others.cpp +++ b/src/hooks/others.cpp @@ -154,7 +154,7 @@ bool DispatchUserMessage_hook(void* thisptr, int type, bf_read& buf) { void LevelInit_hook(void* thisptr, const char* newmap) { ((LevelInit_t*) hooks::hkClientMode->GetMethod(hooks::offLevelInit))(thisptr, newmap); - g_IEngine->ExecuteClientCmd("exec cat_matchexec"); + g_IEngine->ClientCmd_Unrestricted("exec cat_matchexec"); hacks::shared::aimbot::Reset(); hacks::shared::airstuck::Reset(); // LEVEL_SHUTDOWN(FollowBot);