diff --git a/cathook/src/hacks/Aimbot.cpp b/cathook/src/hacks/Aimbot.cpp index fb81c142..bc93d006 100644 --- a/cathook/src/hacks/Aimbot.cpp +++ b/cathook/src/hacks/Aimbot.cpp @@ -298,6 +298,7 @@ void Aimbot::ProcessUserCmd(CUserCmd* cmd) { } if (charge >= v_fAutoShootHuntsmanCharge->GetFloat()) { cmd->buttons &= ~IN_ATTACK; + g_phAntiAim->AddSafeTicks(3); } if (!(cmd->buttons & IN_ATTACK) && m_bSilentHuntsman) { Aim(target_highest, cmd); diff --git a/cathook/src/hacks/AntiAim.cpp b/cathook/src/hacks/AntiAim.cpp index 0d502c5f..ae9af8b3 100644 --- a/cathook/src/hacks/AntiAim.cpp +++ b/cathook/src/hacks/AntiAim.cpp @@ -21,13 +21,14 @@ AntiAim::AntiAim() { this->v_YawMode = new CatVar(CV_ENUM, "aa_yaw_mode", "3", "Yaw mode", new CatEnum({ "KEEP", "STATIC", "RANDOM", "SPIN" }), "Yaw mode"); this->v_bNoClamping = new CatVar(CV_SWITCH, "aa_no_clamp", "0", "Don't clamp angles", NULL, "Use this with STATIC mode for unclamped manual angles"); this->v_flRoll = new CatVar(CV_FLOAT, "aa_roll", "0", "Roll", NULL, "Roll angle. ???", true, -180, 180); + AddSafeTicks(0); } float yaw = -180; float pitch = -89; void AntiAim::AddSafeTicks(int ticks) { - m_iSafeTicks += ticks; + m_iSafeTicks = ticks; } void AntiAim::ProcessUserCmd(CUserCmd* cmd) { @@ -35,14 +36,21 @@ void AntiAim::ProcessUserCmd(CUserCmd* cmd) { if (cmd->buttons & IN_USE) { return; } - if (cmd->buttons & IN_ATTACK) { + + if ((cmd->buttons & IN_ATTACK) && (LOCAL_W->m_iClassID != g_pClassID->CTFCompoundBow)) { if (CanShoot()) return; } if ((cmd->buttons & IN_ATTACK2) && g_pLocalPlayer->weapon()->m_iClassID == g_pClassID->CTFLunchBox) return; - if (g_pLocalPlayer->bAttackLastTick) return; - if (GetWeaponMode(g_pLocalPlayer->entity) == weaponmode::weapon_melee || - GetWeaponMode(g_pLocalPlayer->entity) == weaponmode::weapon_throwable) return; + weaponmode mode = GetWeaponMode(g_pLocalPlayer->entity); + if (mode == weapon_melee || mode == weapon_throwable || (mode == weapon_projectile && (LOCAL_W->m_iClassID != g_pClassID->CTFCompoundBow))) { + if ((cmd->buttons & IN_ATTACK) || (cmd->buttons & IN_ATTACK2) || g_pLocalPlayer->bAttackLastTick) { + AddSafeTicks(4); + } + } + if ((LOCAL_W->m_iClassID == g_pClassID->CTFCompoundBow) && !(cmd->buttons & IN_ATTACK)) { + if (g_pLocalPlayer->bAttackLastTick) AddSafeTicks(4); + } float p = cmd->viewangles.x; float y = cmd->viewangles.y; diff --git a/cathook/src/hacks/Misc.cpp b/cathook/src/hacks/Misc.cpp index 5f6fefd1..7c783101 100644 --- a/cathook/src/hacks/Misc.cpp +++ b/cathook/src/hacks/Misc.cpp @@ -626,6 +626,7 @@ void Misc::Draw() { AddSideString(colors::white, "FrameCount: %i", interfaces::gvars->framecount); float speed, gravity; GetProjectileData(g_pLocalPlayer->weapon(), speed, gravity); + AddSideString(colors::white, "ALT: %i", g_pLocalPlayer->bAttackLastTick); AddSideString(colors::white, "Speed: %f", speed); AddSideString(colors::white, "Gravity: %f", gravity); AddSideString(colors::white, "CIAC: %i", *(bool*)(RAW_ENT(LOCAL_W) + 2380)); diff --git a/cathook/src/hooks/CreateMove.cpp b/cathook/src/hooks/CreateMove.cpp index efb70e23..7e91e959 100644 --- a/cathook/src/hooks/CreateMove.cpp +++ b/cathook/src/hooks/CreateMove.cpp @@ -169,6 +169,7 @@ bool CreateMove_hook(void* thisptr, float inputSample, CUserCmd* cmd) { // PROF_END("CreateMove"); + g_pLocalPlayer->bAttackLastTick = (cmd->buttons & IN_ATTACK); return ret; SEGV_END;