From 607019470f4bc9116ddb378089157fee6cb65de3 Mon Sep 17 00:00:00 2001 From: G-4-M-3-R <69512711+G-4-M-3-R@users.noreply.github.com> Date: Sat, 26 Sep 2020 17:19:57 +0930 Subject: [PATCH] Add files via upload --- src/hacks/AutoBackstab.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hacks/AutoBackstab.cpp b/src/hacks/AutoBackstab.cpp index feec8a9e..23d5cdcc 100644 --- a/src/hacks/AutoBackstab.cpp +++ b/src/hacks/AutoBackstab.cpp @@ -138,7 +138,7 @@ static bool doLegitBackstab() return false; int index = reinterpret_cast(trace.m_pEnt)->entindex(); auto ent = ENTITY(index); - if (index == 0 || index > g_IEngine->GetMaxClients() || !ent->m_bEnemy() || !player_tools::shouldTarget(ent)) + if (index == 0 || index > g_IEngine->GetMaxClients() || !ent->m_bEnemy() || !player_tools::shouldTarget(ent) || IsPlayerInvulnerable(ent)) return false; if (angleCheck(ENTITY(index), std::nullopt, g_pLocalPlayer->v_OrigViewangles) || canFaceStab(ENTITY(index))) { @@ -158,7 +158,7 @@ static bool doRageBackstab() for (int i = 1; i <= g_IEngine->GetMaxClients(); i++) { auto ent = ENTITY(i); - if (CE_BAD(ent) || ent->m_flDistance() > swingrange * 4 || !ent->m_bEnemy() || !ent->m_bAlivePlayer() || g_pLocalPlayer->entity_idx == ent->m_IDX) + if (CE_BAD(ent) || ent->m_flDistance() > swingrange * 4 || !ent->m_bEnemy() || !ent->m_bAlivePlayer() || g_pLocalPlayer->entity_idx == ent->m_IDX || IsPlayerInvulnerable(ent)) continue; if (!player_tools::shouldTarget(ent)) continue; @@ -204,7 +204,7 @@ static bool doRageBackstab() { int index = reinterpret_cast(trace.m_pEnt)->entindex(); auto ent = ENTITY(index); - if (index == 0 || index > PLAYER_ARRAY_SIZE || !ent->m_bEnemy() || !player_tools::shouldTarget(ent)) + if (index == 0 || index > PLAYER_ARRAY_SIZE || !ent->m_bEnemy() || !player_tools::shouldTarget(ent) || IsPlayerInvulnerable(ent)) continue; if (angleCheck(ent, std::nullopt, newangle)) { @@ -276,7 +276,7 @@ static bool doBacktrackStab(bool legit = false) { CachedEntity *ent = ENTITY(i); // Targeting checks - if (CE_BAD(ent) || !ent->m_bAlivePlayer() || !ent->m_bEnemy() || !player_tools::shouldTarget(ent)) + if (CE_BAD(ent) || !ent->m_bAlivePlayer() || !ent->m_bEnemy() || !player_tools::shouldTarget(ent)|| IsPlayerInvulnerable(ent)) continue; // Get the best tick for that ent